-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (35 loc) · 870 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
36
37
38
39
40
/**
* Created by Donny on 2017/5/4.
*/
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('js', function () {
return gulp.src(['./js/*/*.js', './js/*.js'])
.pipe(concat('bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('./build/'));
});
gulp.task('serve', ['js'], function () {
browserSync.init({
server: {
baseDir: "./"
}
});
gulp.watch([
"*.html",
"tpls/*.html"
], ['reload']);
gulp.watch([
"css/*.css"
], ['reload']);
gulp.watch([
"js/**/*.js"
], ['js', 'reload']);
}
);
gulp.task('reload', function () {
browserSync.reload();
});
gulp.task('default', ['serve']);