UNPKG

656 BJavaScriptView Raw
1
2const fs = require('fs');
3const path = require('path');
4
5module.exports = {
6
7 // 当前配置文件的相对路径上下文
8 path: __dirname,
9
10 // package.json路径
11 pkg: '.',
12
13 // 注册任务
14 task(cuf, pkg, rootPath) {
15
16 let banner = `
17/*!
18* Debug - ${pkg.description}
19* ${pkg.repository.url}
20*
21* author ${pkg.author}
22*
23* version ${pkg.version}
24*
25* Copyright 心叶
26* Released under the ${pkg.license} license
27*
28* Date:${new Date()}
29*/
30 `;
31
32 [
33 path.join(rootPath, './build/debug.console.min.js')
34 ].forEach(targetPath => {
35
36 fs.writeFileSync(targetPath, banner + "\n" + fs.readFileSync(targetPath));
37
38 });
39
40 }
41};
\No newline at end of file