@@ -4,6 +4,7 @@ var browserify = require('browserify')
4
4
, clean = require ( 'gulp-clean' )
5
5
, connect = require ( 'gulp-connect' )
6
6
, eslint = require ( 'gulp-eslint' )
7
+ , glob = require ( 'glob' )
7
8
, gulp = require ( 'gulp' )
8
9
, mocha = require ( 'gulp-mocha' )
9
10
, ngmin = require ( 'gulp-ngmin' )
@@ -14,13 +15,26 @@ var browserify = require('browserify')
14
15
15
16
/*
16
17
* Useful tasks:
17
- * - gulp fast: browserifies, no minification, does not start server.
18
- * - gupl watch: starts server, browserify & live reload on changes,
19
- * no minification.
20
- * - gulp: browserifies and minifies, does not start server.
18
+ * - gulp fast:
19
+ * - linting
20
+ * - unit tests
21
+ * - browserification
22
+ * - no minification, does not start server.
23
+ * - gulp watch:
24
+ * - starts server with live reload enabled
25
+ * - lints, unit tests, browserifies and live-reloads changes in browser
26
+ * - no minification
27
+ * - gulp:
28
+ * - linting
29
+ * - unit tests
30
+ * - browserification
31
+ * - minification and browserification of minified sources
32
+ * - start server for e2e tests
33
+ * - run Protractor End-to-end tests
34
+ * - stop server immediately when e2e tests have finished
21
35
*
22
- * At development time, you should usually just have run 'gulp watch' in the
23
- * background.
36
+ * At development time, you should usually just have 'gulp watch' running in the
37
+ * background all the time. Use 'gulp' before releases .
24
38
*/
25
39
26
40
var liveReload = true ;
@@ -48,7 +62,7 @@ gulp.task('unit', function () {
48
62
. pipe ( mocha ( { reporter : 'dot' } ) ) ;
49
63
} ) ;
50
64
51
- gulp . task ( 'browserify' , [ 'lint' , 'unit' ] , function ( ) {
65
+ gulp . task ( 'browserify' , /* ['lint', 'unit'],*/ function ( ) {
52
66
return browserify ( './app/js/app.js' )
53
67
. bundle ( { debug : true } )
54
68
. pipe ( source ( 'app.js' ) )
@@ -73,6 +87,18 @@ gulp.task('browserify-min', ['ngmin'], function() {
73
87
. pipe ( gulp . dest ( './app/dist/' ) ) ;
74
88
} ) ;
75
89
90
+ gulp . task ( 'browserify-tests' , function ( ) {
91
+ var bundler = browserify ( ) ;
92
+ glob . sync ( './test/unit/**/*.js' )
93
+ . forEach ( function ( file ) {
94
+ bundler . add ( file ) ;
95
+ } )
96
+ return bundler
97
+ . bundle ( { debug : true } )
98
+ . pipe ( source ( 'browserified_tests.js' ) )
99
+ . pipe ( gulp . dest ( './test/browserified' ) ) ;
100
+ } ) ;
101
+
76
102
gulp . task ( 'server' , [ 'browserify' ] , function ( ) {
77
103
connect . server ( {
78
104
root : 'app' ,
0 commit comments