@@ -17,6 +17,7 @@ var plugins = gulpLoadPlugins();
1717var config ;
1818
1919const paths = {
20+ appPath : require ( './bower.json' ) . appPath || 'client' ,
2021 client : {
2122 assets : 'client/assets/**/*' ,
2223 images : 'client/assets/images/*' ,
@@ -164,7 +165,7 @@ gulp.task('inject:<%= styleExt %>', () => {
164165 . replace ( '/client/app/' , '' )
165166 . replace ( '/client/components/' , '../components/' )
166167 . replace ( / _ ( .* ) .< % = s t y l e E x t % > / , ( match , p1 , offset , string ) => p1 ) ;
167- return ` @import ' ${ newPath } ';`
168+ return ' @import \'' + newPath + '\';' ;
168169 }
169170 } ) )
170171 . pipe ( gulp . dest ( 'client/app' ) ) ;
@@ -241,15 +242,15 @@ gulp.task('watch', () => {
241242 . pipe ( lintServerScripts ( ) )
242243 . pipe ( plugins . livereload ( ) ) ;
243244
244- gulp . watch ( 'bower.json' , [ 'bower ' ] ) ;
245+ gulp . watch ( 'bower.json' , [ 'wiredep:client ' ] ) ;
245246} ) ;
246247
247248gulp . task ( 'serve' , cb => {
248249 runSequence ( 'clean:tmp' ,
249250 [ 'lint:scripts' ] ,
250251 'inject:js' ,
251252 'inject:css' ,
252- 'bower ' , < % if ( filters . babel || filters . coffee ) { % >
253+ 'wiredep:client ' , < % if ( filters . babel || filters . coffee ) { % >
253254 [ 'transpile' , 'styles' ] , < % } else { % >
254255 'styles' , < % } % >
255256 ['start:server', 'start:client'],
@@ -273,14 +274,38 @@ gulp.task('test:client', () => {
273274} ) ;
274275
275276// inject bower components
276- gulp . task ( 'bower ' , ( ) => {
277+ gulp . task ( 'wiredep:client ' , ( ) => {
277278 return gulp . src ( paths . views . main )
278279 . pipe ( wiredep ( {
279- exclude : [ / b o o t s t r a p - s a s s - o f f i c i a l / , / b o o t s t r a p .j s / , '/json3/' , '/es5-shim/' , / b o o t s t r a p .c s s / , / f o n t - a w e s o m e .c s s / ]
280+ exclude : [
281+ / b o o t s t r a p - s a s s - o f f i c i a l / ,
282+ / b o o t s t r a p .j s / ,
283+ '/json3/' ,
284+ '/es5-shim/' ,
285+ / b o o t s t r a p .c s s / ,
286+ / f o n t - a w e s o m e .c s s /
287+ ] ,
288+ ignorePath : paths . appPath
280289 } ) )
281290 . pipe ( gulp . dest ( 'client/' ) ) ;
282291} ) ;
283292
293+ gulp . task ( 'wiredep:test' , ( ) => {
294+ gulp . src ( paths . karma )
295+ . pipe ( wiredep ( {
296+ exclude : [
297+ / b o o t s t r a p - s a s s - o f f i c i a l / ,
298+ / b o o t s t r a p .j s / ,
299+ '/json3/' ,
300+ '/es5-shim/' ,
301+ / b o o t s t r a p .c s s / ,
302+ / f o n t - a w e s o m e .c s s /
303+ ] ,
304+ devDependencies : true
305+ } ) )
306+ . pipe ( gulp . dest ( './' ) ) ;
307+ } ) ;
308+
284309/********************
285310 * Build
286311 ********************/
@@ -290,7 +315,7 @@ gulp.task('build', cb => {
290315 runSequence (
291316 'clean:dist' ,
292317 'inject' ,
293- 'bower ' ,
318+ 'wiredep:client ' ,
294319 [
295320 'build:images' ,
296321 'copy:extras' ,
0 commit comments