@@ -133,40 +133,46 @@ gulp.task('inject', cb => {
133133
134134gulp . task ( 'inject:js' , ( ) => {
135135 return gulp . src ( paths . mainView )
136- . pipe ( plugins . inject ( gulp . src ( _ . union (
137- paths . client . scripts ,
138- [ '!client/**/*.spec.<%= scriptExt %>' ]
139- ) , { read : false } ) , {
140- starttag : '<!-- injector:js -->' ,
141- endtag : '<!-- endinjector -->' ,
142- transform : ( filepath ) => '<script src="' + filepath . replace ( '/client/' , '' ) + '"></script>'
143- } ) )
136+ . pipe ( plugins . inject (
137+ gulp . src ( _ . union ( paths . client . scripts , [ '!client/**/*.spec.<%= scriptExt %>' ] ) , { read : false } )
138+ . pipe ( plugins . sort ( ) )
139+ , {
140+ starttag : '<!-- injector:js -->' ,
141+ endtag : '<!-- endinjector -->' ,
142+ transform : ( filepath ) => '<script src="' + filepath . replace ( '/client/' , '' ) + '"></script>'
143+ } ) )
144144 . pipe ( gulp . dest ( 'client' ) ) ;
145145} ) ;
146146
147147gulp . task ( 'inject:css' , ( ) => {
148148 return gulp . src ( paths . mainView )
149- . pipe ( plugins . inject ( gulp . src ( '/client/**/*.css' , { read : false } ) , {
150- starttag : '<!-- injector:css -->' ,
151- endtag : '<!-- endinjector -->' ,
152- transform : ( filepath ) => '<link rel="stylesheet" href="' + filepath . replace ( '/client/' , '' ) . replace ( '/.tmp/' , '' ) + '">'
153- } ) )
149+ . pipe ( plugins . inject (
150+ gulp . src ( '/client/**/*.css' , { read : false } )
151+ . pipe ( plugins . sort ( ) )
152+ , {
153+ starttag : '<!-- injector:css -->' ,
154+ endtag : '<!-- endinjector -->' ,
155+ transform : ( filepath ) => '<link rel="stylesheet" href="' + filepath . replace ( '/client/' , '' ) . replace ( '/.tmp/' , '' ) + '">'
156+ } ) )
154157 . pipe ( gulp . dest ( 'client' ) ) ;
155158} ) ;
156159
157160gulp . task ( 'inject:<%= styleExt %>' , ( ) => {
158161 return gulp . src ( 'client/app/app.<%= styleExt %>' )
159- . pipe ( plugins . inject ( gulp . src ( _ . union ( paths . client . styles , [ '!' + paths . client . mainStyle ] ) , { read : false } ) , {
160- starttag : '// injector' ,
161- endtag : '// endinjector' ,
162- transform : ( filepath ) => {
163- let newPath = filepath
164- . replace ( '/client/app/' , '' )
165- . replace ( '/client/components/' , '../components/' )
166- . replace ( / _ ( .* ) .< % = s t y l e E x t % > / , ( match , p1 , offset , string ) => p1 ) ;
167- return '@import \'' + newPath + '\';' ;
168- }
169- } ) )
162+ . pipe ( plugins . inject (
163+ gulp . src ( _ . union ( paths . client . styles , [ '!' + paths . client . mainStyle ] ) , { read : false } )
164+ . pipe ( plugins . sort ( ) )
165+ , {
166+ starttag : '// injector' ,
167+ endtag : '// endinjector' ,
168+ transform : ( filepath ) => {
169+ let newPath = filepath
170+ . replace ( '/client/app/' , '' )
171+ . replace ( '/client/components/' , '../components/' )
172+ . replace ( / _ ( .* ) .< % = s t y l e E x t % > / , ( match , p1 , offset , string ) => p1 ) ;
173+ return '@import \'' + newPath + '\';' ;
174+ }
175+ } ) )
170176 . pipe ( gulp . dest ( 'client/app' ) ) ;
171177} ) ;
172178
0 commit comments