@@ -67,7 +67,7 @@ gulp.task('build-browser', function () {
6767 cache : { } ,
6868 standalone : 'neo4j' ,
6969 packageCache : { }
70- } ) . transform ( babelify . configure ( { presets : [ 'env' ] , ignore : / e x t e r n a l / } ) )
70+ } ) . transform ( babelifyTransform ( ) )
7171 . transform ( browserifyTransformNodeToBrowserRequire ( ) )
7272 . bundle ( ) ;
7373
@@ -100,20 +100,18 @@ gulp.task('build-browser-test', function(){
100100 cb ( ) ;
101101 } ) )
102102 . pipe ( through . obj ( function ( testFiles , enc , cb ) {
103- browserify ( {
103+ browserify ( {
104104 entries : testFiles ,
105105 cache : { } ,
106106 debug : true
107- } ) . transform ( babelify . configure ( {
108- presets : [ 'env' ] , plugins : [ 'transform-runtime' ] , ignore : / e x t e r n a l /
109- } ) )
110- . transform ( browserifyTransformNodeToBrowserRequire ( ) )
111- . bundle ( function ( err , res ) {
112- cb ( ) ;
113- } )
114- . on ( 'error' , gutil . log )
115- . pipe ( source ( 'neo4j-web.test.js' ) )
116- . pipe ( gulp . dest ( browserOutput ) )
107+ } ) . transform ( babelifyTransform ( ) )
108+ . transform ( browserifyTransformNodeToBrowserRequire ( ) )
109+ . bundle ( function ( ) {
110+ cb ( ) ;
111+ } )
112+ . on ( 'error' , gutil . log )
113+ . pipe ( source ( 'neo4j-web.test.js' ) )
114+ . pipe ( gulp . dest ( browserOutput ) ) ;
117115 } ,
118116 function ( cb ) {
119117 cb ( )
@@ -123,7 +121,7 @@ gulp.task('build-browser-test', function(){
123121
124122var buildNode = function ( options ) {
125123 return gulp . src ( options . src )
126- . pipe ( babel ( { presets : [ 'env' ] , plugins : [ 'transform-runtime' ] , ignore : [ 'src/external/**/*.js' ] } ) )
124+ . pipe ( babel ( babelConfig ( ) ) )
127125 . pipe ( gulp . dest ( options . dest ) )
128126} ;
129127
@@ -309,6 +307,16 @@ function newJasmineConsoleReporter() {
309307 } ) ;
310308}
311309
310+ function babelifyTransform ( ) {
311+ return babelify . configure ( babelConfig ( ) ) ;
312+ }
313+
314+ function babelConfig ( ) {
315+ return {
316+ presets : [ 'env' ] , plugins : [ 'transform-runtime' ]
317+ } ;
318+ }
319+
312320function browserifyTransformNodeToBrowserRequire ( ) {
313321 var nodeRequire = '/node' ;
314322 var browserRequire = '/browser' ;
0 commit comments