-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (38 loc) · 1.02 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
var gulp = require("gulp");
var babel = require("gulp-babel");
var livereload = require('gulp-livereload');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('build', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('edge'))
});
gulp.task('build:play', function () {
return gulp.src('play/es6/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('play/es5'))
});
gulp.task('watch:play', function () {
livereload.listen();
gulp.watch('play/es6/*.js', ['build:play']);
});
gulp.task('start', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('edge'))
.pipe(livereload());
});
gulp.task('watch', function () {
livereload.listen();
gulp.watch('src/*.js', ['start']);
});
gulp.task('watch:b', function () {
livereload.listen();
gulp.watch('src/*.js', ['build']);
});