kn-cli 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.config.js +4 -0
- package/build/webpack.config.js +12 -2
- package/package.json +1 -1
- package/readme.md +7 -0
package/build/cli.config.js
CHANGED
|
@@ -24,5 +24,9 @@ module.exports = {
|
|
|
24
24
|
// cssSplitMode:false,//false=关闭css文件分隔,将css内置到js内
|
|
25
25
|
// sass:true,//true=开启sass支持,默认仅支持less
|
|
26
26
|
// indexHtml:false,//false=关闭index.html的注入
|
|
27
|
+
// indexHtml:{
|
|
28
|
+
// template:'index_template.html',
|
|
29
|
+
// output:'../index.html',//将index.html输出到 dist目录外的index.html
|
|
30
|
+
// },
|
|
27
31
|
// projectSourceFolder:'./',//项目源代码文件夹所在位置,默认是'src'
|
|
28
32
|
};
|
package/build/webpack.config.js
CHANGED
|
@@ -341,11 +341,21 @@ if(indexHtml){
|
|
|
341
341
|
if(jsSplitMode===true || jsSplitMode?.runtime !== false){
|
|
342
342
|
shareJs.splice(0,0,'runtime');
|
|
343
343
|
}
|
|
344
|
+
let index_template = path.join(dirname, 'index.html');
|
|
345
|
+
let index_template_output= 'index.html';
|
|
346
|
+
if(typeof indexHtml ==='object'){
|
|
347
|
+
if(indexHtml.template){
|
|
348
|
+
index_template = path.join(dirname, indexHtml.template);
|
|
349
|
+
}
|
|
350
|
+
if(indexHtml.output){
|
|
351
|
+
index_template_output = indexHtml.output;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
344
354
|
plugins.push(
|
|
345
355
|
new HtmlWebpackPlugin({
|
|
346
356
|
chunks: ['index',...shareJs],
|
|
347
|
-
template:
|
|
348
|
-
filename:
|
|
357
|
+
template: index_template,
|
|
358
|
+
filename: index_template_output,
|
|
349
359
|
inject: true,
|
|
350
360
|
isProd: process.env.build_env == 'prod',
|
|
351
361
|
}),
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -46,6 +46,10 @@ module.exports = {
|
|
|
46
46
|
cssSplitMode:false,//默认:true,false=关闭css文件分隔,将css内置到js内
|
|
47
47
|
sass:true,//默认:false,true=开启sass支持,默认仅支持less
|
|
48
48
|
indexHtml:false,//默认:true,false=关闭index.html的注入
|
|
49
|
+
// indexHtml:{
|
|
50
|
+
// template:'index_template.html',
|
|
51
|
+
// output:'../index.html',//将index.html输出到 dist目录外的index.html
|
|
52
|
+
// },
|
|
49
53
|
projectSourceFolder:'./',//默认:'./public',项目源代码文件夹所在位置,默认是'src'
|
|
50
54
|
site_root_path:'',//默认:'',站点根目录,
|
|
51
55
|
// dist:'dist',// 默认:'dist',编译后文件输出目录
|
|
@@ -57,6 +61,9 @@ module.exports = {
|
|
|
57
61
|
```
|
|
58
62
|
|
|
59
63
|
# 更新日志
|
|
64
|
+
* 1.0.22
|
|
65
|
+
1. cli.config.js 扩展indexHtml的配置项,详细参考注释
|
|
66
|
+
|
|
60
67
|
* 1.0.21
|
|
61
68
|
1. cli.config.js内扩展了copyFolder配置项目的功能,现在支持更多配置,详细参考注释
|
|
62
69
|
|