File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
csp /.idea
2
2
.idea
3
3
node_modules
4
- build
4
+ build
5
+ package-lock.json
Original file line number Diff line number Diff line change @@ -26,13 +26,23 @@ gulp.task('lint', function () {
26
26
} ) ;
27
27
28
28
gulp . task ( 'minify:js' , function ( ) {
29
+ var assets = useref . assets ( ) ;
29
30
return gulp . src ( './csp/index.html' )
30
- . pipe ( useref ( ) )
31
+ . pipe ( assets )
31
32
. pipe ( gulpIf ( "*.js" , replace ( '"{{package.json.version}}"' , '"' + p . version + '"' ) ) )
32
33
. pipe ( gulpIf ( "*.js" , traceur ( ) ) )
33
34
. pipe ( gulpIf ( "*.js" , uglify ( ) ) )
34
35
. pipe ( gulpIf ( "*.html" , htmlmin ( { empty : false } ) ) )
35
- . pipe ( gulp . dest ( 'build' ) ) ;
36
+ . pipe ( assets . restore ( ) )
37
+ . pipe ( useref ( ) )
38
+ //.pipe(gulp.dest('build'))
39
+ . pipe ( through . obj ( function ( chunk , enc , cb ) {
40
+ if ( ! fs . existsSync ( "./build" ) ) fs . mkdirSync ( "./build" ) ;
41
+ if ( ! fs . existsSync ( "./build/src" ) ) fs . mkdirSync ( "./build/src" ) ;
42
+ fs . writeFileSync ( "./build/" + chunk . relative , chunk . contents ) ;
43
+ cb ( null , chunk ) ;
44
+ } ) )
45
+ . pipe ( debug ( { title : "after save" } ) ) ;
36
46
} ) ;
37
47
38
48
gulp . task ( 'minify:css' , function ( ) {
Original file line number Diff line number Diff line change 17
17
"gulp-replace" : " ^0.6.1" ,
18
18
"gulp-traceur-compiler" : " ^1.1.4" ,
19
19
"gulp-uglify" : " ^3.0.0" ,
20
- "gulp-useref" : " ^3.1.2 " ,
20
+ "gulp-useref" : " ^1.3.0 " ,
21
21
"jshint" : " ^2.9.5" ,
22
22
"through2" : " ^2.0.3"
23
23
},
You can’t perform that action at this time.
0 commit comments