forked from dshongphuc/magic-mouse-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·52 lines (43 loc) · 1.12 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var gulp = require('gulp'),
uglify = require('gulp-uglify-es').default,
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
plumber = require('gulp-plumber');
gulp.task('default', function(done){
// Default task code
console.log("HTTP Server Started");
gulp.series("minify", "sass", "browser");
done();
});
gulp.task('minify', function (done) {
gulp.src('js/*.js')
.pipe(uglify())
.on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); })
.pipe(gulp.dest('dist'))
done();
});
gulp.task('sass', function (done) {
gulp.src('scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('css'))
.pipe(plumber())
done();
});
gulp.task('watch', function () {
gulp.watch('js/*.js', ['minify']);
});
gulp.task('serve', function () {
var files = [
'*.html',
'css/**/*.css',
'js/**/*.js',
'scss/**/*.scss'
];
browserSync.init(files, {
server: {
baseDir: './'
}
});
gulp.watch('scss/*.scss', gulp.series('sass')); // Watching the changes of sass here
});