-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (41 loc) · 1.2 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
var gulp = require("gulp");
var sourcemaps = require("gulp-sourcemaps");
var babel = require("gulp-babel");
var rename = require("gulp-rename");
var concat = require("gulp-concat");
var uglify = require("gulp-uglify");
var browserSync =require('browser-sync').create();
var browserify = require("gulp-browserify");
gulp.task("default", ['test', 'build', 'server'], function () {
gulp.watch("./js/src/**/*.js", ['build']);
});
gulp.task('build', function(){
gulp.src(["./js/src/mask.js", "./js/src/animate.js", "./js/src/init.js"])
.pipe(sourcemaps.init())
.pipe(babel())
//.pipe(uglify())
.pipe(concat("all.js"))
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("./js/dist"));
});
gulp.task("test", ["test-build"], function(){
gulp.watch("./js/test/src/*.js", ["test-build"]);
});
gulp.task("test-build", function(){
gulp.src("./js/test/src/*.js")
.pipe(babel())
.pipe(rename({
prefix: "babel-"
}))
.pipe(gulp.dest("./js/test"));
});
gulp.task('server', function(){
browserSync.init({
server: {
baseDir: './'
},
files: '.',
browser: 'google chrome',
reloadDelay: 1000
});
});