-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (40 loc) · 1.17 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
var gulp = require("gulp"),
Browsersync = require("browser-sync").create(),
reload = Browsersync.reload;
gulpLoadPlugins = require("gulp-load-plugins")
var $ = gulpLoadPlugins();
gulp.task("es6", function() {
return gulp.src('./src/lock.js')
.pipe($.babel({
presets: ['es2015']
}))
.pipe(gulp.dest('./lib'))
.pipe(reload({stream: true}))
})
gulp.task("build", function() {
return gulp.src("./lib/*.js")
.pipe($.uglify())
.pipe(gulp.dest("./lib"));
})
gulp.task("build-css", function() {
return gulp.src("./test/style/css/*.css")
.pipe($.autoprefixer())
.pipe(gulp.dest('./test/style/css'))
})
gulp.task('less', function() {
return gulp.src('./test/style/less/*.less')
.pipe($.less())
.pipe($.autoprefixer())
.pipe(gulp.dest('./test/style/css'))
.pipe(reload({stream: true}))
});
gulp.task("server", ["es6", "less"], function() {
Browsersync.init({
server: {
baseDir: "./"
}
})
gulp.watch("./test/demo.html", reload);
gulp.watch("./test/style/less/{demo,mixin}.less", ['less']);
gulp.watch("./src/lock.js", ['es6']);
})