@@ -63,15 +63,15 @@ function concatJS(data) {
63
63
if ( htmlPaths . every ( path => htmls [ path ] . srcs . indexOf ( src ) !== - 1 ) ||
64
64
include . some ( pattern => minimatch ( src , pattern , { matchBase : true } ) ) ) {
65
65
// remove
66
- log . log ( 'Remove %s from %s' , src , path ) ;
66
+ log . log ( 'update Concate JS: remove %s from %s' , src , path ) ;
67
67
html . $scripts [ src ] . remove ( )
68
68
delete html . $scripts [ src ] ;
69
69
html . srcs . splice ( html . srcs . indexOf ( src ) , 1 ) ;
70
70
commons . push ( src ) ;
71
71
}
72
72
} else {
73
73
// remove
74
- log . log ( 'Remove %s from %s' , src , path ) ;
74
+ log . log ( 'update Concate JS: remove %s from %s' , src , path ) ;
75
75
html . $scripts [ src ] . remove ( )
76
76
delete html . $scripts [ src ] ;
77
77
html . srcs . splice ( html . srcs . indexOf ( src ) , 1 ) ;
@@ -85,30 +85,30 @@ function concatJS(data) {
85
85
const html = htmls [ path ] ;
86
86
html . $ ( 'body' ) . append ( `<script type="text/javascript" src="${ route . format ( bundlePath ) } "></script>` ) ;
87
87
route . set ( path , html . $ . html ( ) ) ;
88
- log . log ( 'Add %s to %s' , route . format ( bundlePath ) , path ) ;
88
+ log . log ( 'update Concate JS: add %s to %s' , route . format ( bundlePath ) , path ) ;
89
89
}
90
90
}
91
91
return commons ;
92
92
} )
93
93
// 3. concat the script
94
94
. then ( ( scripts ) => {
95
95
if ( scripts . length < 1 ) return ;
96
- log . log ( 'Try to concat %s scripts' , scripts . length ) ;
96
+ log . log ( 'update Concate JS: try to concat %s scripts' , scripts . length ) ;
97
97
return Promise . all ( scripts . map ( path => {
98
98
return new Promise ( ( resolve , reject ) => {
99
99
const script = route . get ( path ) ;
100
100
let scriptTxt = '' ;
101
101
script . on ( 'data' , chunk => ( scriptTxt += chunk ) ) ;
102
102
script . on ( 'end' , ( ) => {
103
103
route . remove ( path ) ;
104
- log . info ( 'concat script %s' , path ) ;
104
+ log . info ( 'update Concate JS: concat script %s' , path ) ;
105
105
resolve ( scriptTxt ) ;
106
106
} ) ;
107
107
} ) ;
108
108
} ) ) . then ( results => {
109
109
const bundleScript = results . reduce ( ( txt , script ) => ( txt += script ) , '' ) ;
110
110
route . set ( route . format ( bundlePath ) , bundleScript ) ;
111
- log . info ( 'finish concat js script' ) ;
111
+ log . info ( 'update Concate JS: finish concat js script' ) ;
112
112
} ) ;
113
113
} ) ;
114
114
}
0 commit comments