1- var gulp = require ( 'gulp' ) ;
1+
2+ var gulp = require ( 'gulp' ) ;
23var templateCache = require ( 'gulp-angular-templatecache' ) ;
34var gutil = require ( 'gulp-util' ) ;
45
@@ -11,55 +12,40 @@ webpackDevCfg.devtool = 'sourcemap';
1112webpackDevCfg . debug = true ;
1213var devCompiler = webpack ( webpackDevCfg ) ;
1314
14- gulp . task ( 'tpl-cache' , function ( ) {
15- return gulp . src ( 'app/**/*html' )
16- . pipe ( templateCache ( {
17- standalone : true
18- } ) )
19- . pipe ( gulp . dest ( 'app' ) ) ;
15+ gulp . task ( 'tpl-cache' , function ( ) {
16+ return gulp . src ( 'app/**/*html' )
17+ . pipe ( templateCache ( {
18+ standalone : true
19+ } ) )
20+ . pipe ( gulp . dest ( 'app' ) ) ;
2021} ) ;
2122
22- gulp . task ( 'watch:html' , function ( ) {
23- return gulp . watch ( [ 'app/**/*.html' ] , [ 'tpl-cache' ] ) ;
23+ gulp . task ( 'watch:html' , function ( ) {
24+ return gulp . watch ( [ 'app/**/*.html' ] , [ 'tpl-cache' ] ) ;
2425} ) ;
2526
2627
27- gulp . task ( 'build-dev' , [ 'tpl-cache' , 'webpack:build-dev' ] , function ( ) {
28- gulp . watch ( [ 'app/**/*' ] , [ 'tpl-cache' , 'webpack:build-dev' ] ) ;
29- } ) ;
30-
31- gulp . task ( 'webpack:dev-server' , function ( callback ) {
28+ gulp . task ( 'webpack:dev-server' , function ( callback ) {
3229
33- new WebpackDevServer ( devCompiler , {
34- contentBase : 'public' ,
35- hot : true ,
36- filename : 'bundle.js' ,
37- watchOptions : {
38- aggregateTimeout : 300 ,
39- poll : 1000
40- }
41- } ) . listen ( 8080 , 'localhost' , function ( err ) {
42- if ( err ) throw new gutil . PluginError ( 'webpack-dev-server' , err ) ;
30+ new WebpackDevServer ( devCompiler , {
31+ contentBase : 'public' ,
32+ hot : true ,
33+ filename : 'bundle.js' ,
34+ watchOptions : {
35+ aggregateTimeout : 300 ,
36+ poll : 1000
37+ }
38+ } ) . listen ( 8080 , 'localhost' , function ( err ) {
39+ if ( err ) throw new gutil . PluginError ( 'webpack-dev-server' , err ) ;
4340
44- gutil . log ( '[webpack-dev-server]' , 'http://localhost:8080/webpack-dev-server/index.html' ) ;
41+ gutil . log ( '[webpack-dev-server]' , 'http://localhost:8080/webpack-dev-server/index.html' ) ;
4542
46- callback ( ) ;
47- } ) ;
43+ callback ( ) ;
44+ } ) ;
4845} ) ;
4946
50- gulp . task ( 'webpack:build-dev' , function ( callback ) {
51- devCompiler . run ( function ( err , stats ) {
52- if ( err ) throw new gutil . PluginError ( 'webpack:build-dev' , err ) ;
53- gutil . log ( '[webpack:build-dev]' , stats . toString ( {
54- colors : true
55- } ) ) ;
56- callback ( ) ;
57- } ) ;
58- } ) ;
59-
60-
61- gulp . task ( 'json-server' , function ( ) {
62- require ( './index' ) ;
47+ gulp . task ( 'json-server' , function ( ) {
48+ require ( './index' ) ;
6349} ) ;
6450
65- gulp . task ( 'default' , [ 'json-server' , 'watch:html' , 'webpack:dev-server' ] ) ;
51+ gulp . task ( 'default' , [ 'json-server' , 'watch:html' , 'webpack:dev-server' ] ) ;
0 commit comments