-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gulpfile.js
43 lines (39 loc) · 1016 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
41
42
43
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var babel = require('gulp-babel');
var BABEL_TRANSFORMS = [
'es6.arrowFunctions',
'es6.classes',
'es6.properties.computed',
'es6.constants',
'es6.blockScoping',
'es6.destructuring',
'es6.modules',
'es6.parameters.default',
'es6.templateLiterals',
'es6.forOf',
'regenerator',
'runtime',
'strict',
'es7.asyncFunctions',
'es7.classProperties'
];
gulp.task('ES6', function () {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel({
whitelist: BABEL_TRANSFORMS,
loose: BABEL_TRANSFORMS
}))
.pipe(sourcemaps.write('.', {
includeContent: true,
sourceRoot: '../src'
}))
.pipe(gulp.dest('./_lib'));
});
gulp.task('app', ['ES6'], function () {
var app = require('./_lib/app.js');
});
gulp.task('test', ['ES6'], function () {
var app = require('./_lib/test.js');
});