@@ -5,9 +5,10 @@ var del = require('del');
5
5
6
6
var browserifyCreator = require ( './pipeline/browserify' ) ;
7
7
8
- var args = require ( 'yargs' ) . alias ( 'P' , 'production' )
9
- . alias ( 'D' , 'development' )
10
- . alias ( 'E' , 'example' ) . argv ;
8
+ var args = require ( 'yargs' )
9
+ . alias ( 'P' , 'production' )
10
+ . alias ( 'D' , 'development' )
11
+ . alias ( 'E' , 'example' ) . argv ;
11
12
12
13
var envObject = {
13
14
production : args . production ,
@@ -20,17 +21,21 @@ var buildFunction = browserifyCreator(false, envObject, INFINITE_SOURCE);
20
21
21
22
gulp . task ( 'build-bundle' , buildFunction ) ;
22
23
gulp . task ( 'cleanly-build-bundle' , [ 'clean' ] , buildFunction ) ;
23
- gulp . task ( 'watch-develop-bundle' , browserifyCreator ( true , { development : true } , INFINITE_SOURCE ) ) ;
24
+ gulp . task (
25
+ 'watch-develop-bundle' ,
26
+ browserifyCreator ( true , { development : true } , INFINITE_SOURCE )
27
+ ) ;
24
28
25
29
// This task builds everything for release: the dist
26
30
// folder is populated with react-infinite.js and
27
31
// react-infinite.min.js, while the build folder is
28
32
// provided with a copy of the source transpiled to ES5.
29
33
gulp . task ( 'release' , [ 'cleanly-build-bundle' ] , function ( ) {
30
34
// Transpile CommonJS files to ES5 with React's tools.
31
- gulp . src ( [ './src/**/*.js' , './src/**/*.jsx' ] )
32
- . pipe ( babel ( ) )
33
- . pipe ( gulp . dest ( 'build' ) ) ;
35
+ gulp
36
+ . src ( [ './src/**/*.js' , './src/**/*.jsx' ] )
37
+ . pipe ( babel ( ) )
38
+ . pipe ( gulp . dest ( 'build' ) ) ;
34
39
} ) ;
35
40
36
41
gulp . task ( 'clean' , function ( ) {
@@ -40,31 +45,30 @@ gulp.task('clean', function() {
40
45
// This task is used to build the examples. It is used
41
46
// in the development watch function as well.
42
47
gulp . task ( 'examples' , function ( ) {
43
- gulp . src ( './examples/*.jsx' )
44
- . pipe ( babel ( ) )
45
- . pipe ( gulp . dest ( 'examples' ) ) ;
48
+ gulp . src ( './examples/*.jsx' ) . pipe ( babel ( ) ) . pipe ( gulp . dest ( 'examples' ) ) ;
46
49
} ) ;
47
50
48
51
gulp . task ( 'server' , function ( ) {
49
- gulp . src ( __dirname )
50
- . pipe ( server ( {
51
- port : 8080 ,
52
- directoryListing : true ,
53
- livereload : {
54
- enable : true ,
55
- filter : function ( filename ) {
56
- if ( filename . match ( __dirname + '/examples' ) ) {
57
- return true ;
58
- // The examples draw from /dist, which should change
59
- // when the source files change
60
- } else if ( filename . match ( __dirname + '/dist' ) ) {
61
- return true ;
62
- } else {
63
- return false ;
64
- }
52
+ gulp . src ( __dirname ) . pipe (
53
+ server ( {
54
+ port : 8080 ,
55
+ directoryListing : true ,
56
+ livereload : {
57
+ enable : true ,
58
+ filter : function ( filename ) {
59
+ if ( filename . match ( __dirname + '/examples' ) ) {
60
+ return true ;
61
+ // The examples draw from /dist, which should change
62
+ // when the source files change
63
+ } else if ( filename . match ( __dirname + '/dist' ) ) {
64
+ return true ;
65
+ } else {
66
+ return false ;
65
67
}
66
68
}
67
- } ) ) ;
69
+ }
70
+ } )
71
+ ) ;
68
72
} ) ;
69
73
70
74
// This task is used for development. When run, it sets up
0 commit comments