@@ -11,6 +11,21 @@ const testPath = './test/**/*.spec.js';
1111const libPath = './src/**/*.js' ;
1212const buildPath = './build/**/*.js' ;
1313
14+ const babelConfig = {
15+ "plugins" : [
16+ "transform-es2015-classes" ,
17+ "transform-es2015-destructuring" ,
18+ "transform-es2015-modules-commonjs" ,
19+ "transform-es2015-object-super" ,
20+ "transform-es2015-parameters" ,
21+ "transform-es2015-shorthand-properties" ,
22+ "transform-es2015-spread" ,
23+ "transform-es2015-unicode-regex" ,
24+ "transform-flow-strip-types" ,
25+ "syntax-flow"
26+ ]
27+ } ;
28+
1429gulp . task ( 'remove_flow' , function ( ) {
1530 return gulp . src ( [ libPath ] )
1631 . pipe ( babel ( {
@@ -28,10 +43,8 @@ gulp.task('rollup', ['remove_flow'], function() {
2843
2944gulp . task ( 'babel' , [ 'rollup' ] , function ( ) {
3045 return gulp . src ( './lib/index.js' )
31- . pipe ( sourcemaps . init ( ) )
32- . pipe ( babel ( {
33- "presets" : [ "es2015" , "react" , "stage-0" ]
34- } ) )
46+ . pipe ( sourcemaps . init ( ) )
47+ . pipe ( babel ( babelConfig ) )
3548 . pipe ( sourcemaps . write ( ) )
3649 . pipe ( rename ( "processes.js" ) )
3750 . pipe ( gulp . dest ( './lib' ) ) ;
@@ -44,18 +57,16 @@ gulp.task('build', ['babel'], function() {
4457
4558gulp . task ( 'build_test' , function ( ) {
4659 return gulp . src ( [ testPath ] )
47- . pipe ( sourcemaps . init ( ) )
48- . pipe ( babel ( {
49- "presets" : [ "es2015" , "react" , "stage-0" ]
50- } ) )
60+ . pipe ( sourcemaps . init ( ) )
61+ . pipe ( babel ( babelConfig ) )
5162 . pipe ( sourcemaps . write ( ) )
5263 . pipe ( gulp . dest ( './test_build' ) ) ;
5364} ) ;
5465
5566gulp . task ( 'lint' , function ( ) {
5667 return gulp . src ( [ libPath , testPath ] )
5768 . pipe ( eslint ( ) )
58- . pipe ( eslint . format ( ) )
69+ . pipe ( eslint . format ( ) ) ;
5970} ) ;
6071
6172gulp . task ( 'test' , [ 'lint' , 'build' , 'build_test' ] , function ( ) {
0 commit comments