@@ -5,6 +5,8 @@ var browserSync = require('browser-sync');
55
66var $ = require ( 'gulp-load-plugins' ) ( ) ;
77
8+ var wiredep = require ( 'wiredep' ) . stream ;
9+
810module . exports = function ( options ) {
911 gulp . task ( 'styles' , function ( ) {
1012< % if ( props . cssPreprocessor . key === 'less' ) { % >
@@ -37,6 +39,7 @@ module.exports = function(options) {
3739 } ;
3840
3941 var indexFilter = $ . filter ( 'index.<%= props.cssPreprocessor.extension %>' ) ;
42+ var vendorFilter = $ . filter ( 'vendor.<%= props.cssPreprocessor.extension %>' ) ;
4043< % if ( props . cssPreprocessor . key === 'ruby-sass' ) { % >
4144 var cssFilter = $ . filter ( '**/*.css' ) ;
4245< % } % >
@@ -45,28 +48,31 @@ module.exports = function(options) {
4548 options . src + '/app/index.<%= props.cssPreprocessor.extension %>' ,
4649 options . src + '/app/vendor.<%= props.cssPreprocessor.extension %>'
4750 ] )
48- . pipe ( indexFilter )
49- . pipe ( $ . inject ( injectFiles , injectOptions ) )
50- . pipe ( indexFilter . restore ( ) )
51+ . pipe ( indexFilter )
52+ . pipe ( $ . inject ( injectFiles , injectOptions ) )
53+ . pipe ( indexFilter . restore ( ) )
54+ . pipe ( vendorFilter )
55+ . pipe ( wiredep ( options . wiredep ) )
56+ . pipe ( vendorFilter . restore ( ) )
5157< % if ( props . cssPreprocessor . key === 'ruby-sass' ) { % >
52- . pipe ( $ . rubySass ( sassOptions ) ) . on ( 'error' , options . errorHandler ( 'RubySass' ) )
53- . pipe ( cssFilter )
54- . pipe ( $ . sourcemaps . init ( { loadMaps : true } ) )
58+ . pipe ( $ . rubySass ( sassOptions ) ) . on ( 'error' , options . errorHandler ( 'RubySass' ) )
59+ . pipe ( cssFilter )
60+ . pipe ( $ . sourcemaps . init ( { loadMaps : true } ) )
5561< % } else { % >
56- . pipe ( $ . sourcemaps . init ( ) )
62+ . pipe ( $ . sourcemaps . init ( ) )
5763< % } if ( props . cssPreprocessor . key === 'less' ) { % >
58- . pipe ( $ . less ( lessOptions ) ) . on ( 'error' , options . errorHandler ( 'Less' ) )
64+ . pipe ( $ . less ( lessOptions ) ) . on ( 'error' , options . errorHandler ( 'Less' ) )
5965< % } else if ( props . cssPreprocessor . key === 'node-sass' ) { % >
60- . pipe ( $ . sass ( sassOptions ) ) . on ( 'error' , options . errorHandler ( 'Sass' ) )
66+ . pipe ( $ . sass ( sassOptions ) ) . on ( 'error' , options . errorHandler ( 'Sass' ) )
6167< % } else if ( props . cssPreprocessor . key === 'stylus' ) { % >
62- . pipe ( $ . stylus ( ) ) . on ( 'error' , options . errorHandler ( 'Stylus' ) )
68+ . pipe ( $ . stylus ( ) ) . on ( 'error' , options . errorHandler ( 'Stylus' ) )
6369< % } % >
64- . pipe ( $ . autoprefixer ( ) ) . on ( 'error' , options . errorHandler ( 'Autoprefixer' ) )
65- . pipe ( $ . sourcemaps . write ( ) )
70+ . pipe ( $ . autoprefixer ( ) ) . on ( 'error' , options . errorHandler ( 'Autoprefixer' ) )
71+ . pipe ( $ . sourcemaps . write ( ) )
6672< % if ( props . cssPreprocessor . key === 'ruby-sass' ) { % >
67- . pipe ( cssFilter . restore ( ) )
73+ . pipe ( cssFilter . restore ( ) )
6874< % } % >
69- . pipe ( gulp . dest ( options . tmp + '/serve/app/' ) )
70- . pipe ( browserSync . reload ( { stream : true } ) ) ;
75+ . pipe ( gulp . dest ( options . tmp + '/serve/app/' ) )
76+ . pipe ( browserSync . reload ( { stream : true } ) ) ;
7177 } ) ;
7278} ;
0 commit comments