@@ -23,37 +23,13 @@ var runSequence = require('run-sequence');
2323
2424gulp . task ( 'default' , [ "test" ] ) ;
2525
26- /** Build all-in-one files for use in the browser */
27- gulp . task ( 'browser' , function ( ) {
26+ gulp . task ( 'browser' , function ( cb ) {
27+ runSequence ( 'build-browser-test' , 'build-browser' , cb ) ;
28+ } )
2829
30+ /** Build all-in-one files for use in the browser */
31+ gulp . task ( 'build-browser' , function ( ) {
2932 var browserOutput = 'build/browser' ;
30- var testFiles = [ ] ;
31- gulp . src ( './test/**/*.test.js' )
32- . pipe ( through . obj ( function ( file , enc , cb ) {
33- testFiles . push ( file . path ) ;
34- cb ( ) ;
35- } , function ( cb ) {
36- // At end-of-stream, push the list of files to the next step
37- this . push ( testFiles ) ;
38- cb ( ) ;
39- } ) )
40- . pipe ( through . obj ( function ( testFiles , enc , cb ) {
41- browserify ( {
42- entries : testFiles ,
43- cache : { } ,
44- debug : true
45- } ) . transform ( babelify . configure ( {
46- ignore : / e x t e r n a l /
47- } ) )
48- . bundle ( )
49- . on ( 'error' , gutil . log )
50- . pipe ( source ( 'neo4j-web.test.js' ) )
51- . pipe ( buffer ( ) )
52- . pipe ( uglify ( ) )
53- . pipe ( gulp . dest ( browserOutput ) ) ;
54- } ) ) ;
55-
56-
5733 // Our app bundler
5834 var appBundler = browserify ( {
5935 entries : [ 'lib/neo4j.js' ] ,
@@ -78,6 +54,41 @@ gulp.task('browser', function () {
7854 . pipe ( gulp . dest ( browserOutput ) ) ;
7955} ) ;
8056
57+ gulp . task ( 'build-browser-test' , function ( ) {
58+ var browserOutput = 'build/browser' ;
59+ var testFiles = [ ] ;
60+ return gulp . src ( './test/**/*.test.js' )
61+ . pipe ( through . obj ( function ( file , enc , cb ) {
62+ testFiles . push ( file . path ) ;
63+ cb ( ) ;
64+ } , function ( cb ) {
65+ // At end-of-stream, push the list of files to the next step
66+ this . push ( testFiles ) ;
67+ cb ( ) ;
68+ } ) )
69+ . pipe ( through . obj ( function ( testFiles , enc , cb ) {
70+ browserify ( {
71+ entries : testFiles ,
72+ cache : { } ,
73+ debug : true
74+ } ) . transform ( babelify . configure ( {
75+ ignore : / e x t e r n a l /
76+ } ) )
77+ . bundle ( function ( err , res ) {
78+ cb ( ) ;
79+ } )
80+ . on ( 'error' , gutil . log )
81+ . pipe ( source ( 'neo4j-web.test.js' ) )
82+ . pipe ( buffer ( ) )
83+ . pipe ( uglify ( ) )
84+ . pipe ( gulp . dest ( browserOutput ) )
85+ } ,
86+ function ( cb ) {
87+ cb ( )
88+ }
89+ ) ) ;
90+ } ) ;
91+
8192var compress = function ( source , dest , filename ) {
8293
8394}
0 commit comments