kn-cli 1.0.20 → 1.0.21
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 +1 -0
- package/build/webpack.config.js +8 -3
- package/package.json +1 -1
- package/readme.md +4 -0
package/build/cli.config.js
CHANGED
|
@@ -10,6 +10,7 @@ module.exports = {
|
|
|
10
10
|
// 'home/index': 'src/jsx/home/index.jsx',
|
|
11
11
|
// },
|
|
12
12
|
// copyFolder:['static','pluginjs'],//完整复制的文件夹,除了static和pluginjs外其它需要被完整复制的文件夹
|
|
13
|
+
// copyFolder:[{from:'static',to:'folder/static'}],//支持目录自定义配置
|
|
13
14
|
// hashMode:false,//false=关闭编译后的文件使用hash模式使用原始文件名
|
|
14
15
|
// cssModule:'global',//css引用默认的模式,global/local/(path)=>global/local
|
|
15
16
|
// cssModule: (resourcePath) => {
|
package/build/webpack.config.js
CHANGED
|
@@ -352,10 +352,15 @@ if(indexHtml){
|
|
|
352
352
|
)
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
let COPY_FOLDER= CLI_CONFIG.copyFolder?['static','pluginjs'].concat(CLI_CONFIG.copyFolder):['static','pluginjs'];
|
|
356
|
+
COPY_FOLDER = [...new Set(COPY_FOLDER)];
|
|
356
357
|
const folderPatterns = COPY_FOLDER.map(folder=>{
|
|
357
|
-
|
|
358
|
-
}
|
|
358
|
+
if(typeof folder === 'string'){
|
|
359
|
+
return { from: dirname + '/' + folder, to: dirname + '/'+distFolder+'/' + folder ,noErrorOnMissing:true};
|
|
360
|
+
}else{
|
|
361
|
+
return { from: dirname + '/' + folder.from, to: dirname + '/'+distFolder+'/' + folder.to ,noErrorOnMissing:true};
|
|
362
|
+
}
|
|
363
|
+
});
|
|
359
364
|
plugins.push(
|
|
360
365
|
new CopyPlugin({
|
|
361
366
|
patterns: folderPatterns||[]
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -29,6 +29,7 @@ module.exports = {
|
|
|
29
29
|
'home/index': 'src/jsx/home/index.jsx',
|
|
30
30
|
},
|
|
31
31
|
copyFolder:['static','pluginjs'],//默认:[],完整复制的文件夹,除了static和pluginjs外其它需要被完整复制的文件夹
|
|
32
|
+
// copyFolder:[{from:'static',to:'folder/static'}],//支持目录自定义配置
|
|
32
33
|
hashMode:false,//默认:true,false=关闭编译后的文件使用hash模式使用原始文件名
|
|
33
34
|
cssModule:'global',//默认:local, css引用默认的模式,global/local/(path)=>global/local
|
|
34
35
|
// cssModule: (resourcePath) => {
|
|
@@ -56,6 +57,9 @@ module.exports = {
|
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
# 更新日志
|
|
60
|
+
* 1.0.21
|
|
61
|
+
1. cli.config.js内扩展了copyFolder配置项目的功能,现在支持更多配置,详细参考注释
|
|
62
|
+
|
|
59
63
|
* 1.0.20
|
|
60
64
|
1. cli.config.js增加配置site_root_path,用于设置站点根目录
|
|
61
65
|
|