forked from dbillingham/KarmaSlack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (27 loc) · 801 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
var gulp = require("gulp"),
sourcemaps = require('gulp-sourcemaps'),
babel = require("gulp-babel"),
path = require('path'),
clean = require("gulp-clean");
var paths = {
es6: ['es6/**/*.js'],
es5: 'es5',
// Must be absolute or relative to source map
sourceRoot: path.join(__dirname, 'es6')
};
gulp.task('babel', ['cleanEs5Dir'], function () {
return gulp.src(paths.es6)
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.',
{ sourceRoot: paths.sourceRoot }))
.pipe(gulp.dest(paths.es5));
});
gulp.task('cleanEs5Dir', function () {
return gulp.src(paths.es5, {read: false})
.pipe(clean());
});
gulp.task('watch', function() {
gulp.watch(paths.es6, ['babel']);
});
gulp.task('default', ['watch']);