Skip to content

Commit 4ab7315

Browse files
committed
fix: format the log info
1 parent 1516c9a commit 4ab7315

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/concatJS.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ function concatJS(data) {
6363
if (htmlPaths.every(path => htmls[path].srcs.indexOf(src) !== -1) ||
6464
include.some(pattern => minimatch(src, pattern, { matchBase: true }))) {
6565
// remove
66-
log.log('Remove %s from %s', src, path);
66+
log.log('update Concate JS: remove %s from %s', src, path);
6767
html.$scripts[src].remove()
6868
delete html.$scripts[src];
6969
html.srcs.splice(html.srcs.indexOf(src), 1);
7070
commons.push(src);
7171
}
7272
} else {
7373
// remove
74-
log.log('Remove %s from %s', src, path);
74+
log.log('update Concate JS: remove %s from %s', src, path);
7575
html.$scripts[src].remove()
7676
delete html.$scripts[src];
7777
html.srcs.splice(html.srcs.indexOf(src), 1);
@@ -85,30 +85,30 @@ function concatJS(data) {
8585
const html = htmls[path];
8686
html.$('body').append(`<script type="text/javascript" src="${route.format(bundlePath)}"></script>`);
8787
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);
8989
}
9090
}
9191
return commons;
9292
})
9393
// 3. concat the script
9494
.then((scripts) => {
9595
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);
9797
return Promise.all(scripts.map(path => {
9898
return new Promise((resolve, reject) => {
9999
const script = route.get(path);
100100
let scriptTxt = '';
101101
script.on('data', chunk => (scriptTxt += chunk));
102102
script.on('end', () => {
103103
route.remove(path);
104-
log.info('concat script %s', path);
104+
log.info('update Concate JS: concat script %s', path);
105105
resolve(scriptTxt);
106106
});
107107
});
108108
})).then(results => {
109109
const bundleScript = results.reduce((txt, script) => (txt += script), '');
110110
route.set(route.format(bundlePath), bundleScript);
111-
log.info('finish concat js script');
111+
log.info('update Concate JS: finish concat js script');
112112
});
113113
});
114114
}

0 commit comments

Comments
 (0)