-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (31 loc) · 967 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var uglify = require('gulp-uglifyjs');
gulp.task('sass', function () {
return gulp.src('./public/sass/main.scss')
.pipe(sass()) //using gulp-sass
.pipe(gulp.dest('./public/stylesheets/'))
.pipe(browserSync.reload({
stream: true
}))
});
gulp.task('browserSync', function () {
browserSync.init({
proxy: "localhost:3000"
})
});
gulp.task('watch', ['browserSync', 'sass'], function () {
gulp.watch('./public/sass/*.scss', ['sass']);
// other watches
gulp.watch('./views/*.jade', browserSync.reload);
gulp.watch('./public/javascripts/*.js', ['uglify']);
});
gulp.task('uglify', function() {
gulp.src('public/javascripts/*.js')
.pipe(uglify())
.pipe(gulp.dest('./public/minjs'))
.pipe(browserSync.reload({
stream: true
}))
});