kn-cli 1.0.19 → 1.0.20

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.
@@ -4,6 +4,7 @@ module.exports = {
4
4
  less:{
5
5
  javascriptEnabled:false,//是否开启less js
6
6
  },
7
+ // site_root_path:'/dist/',// 默认:'',站点根目录
7
8
  // 自定义多入口
8
9
  // entry:{
9
10
  // 'home/index': 'src/jsx/home/index.jsx',
@@ -11,7 +11,6 @@ const CopyPlugin = require('copy-webpack-plugin');
11
11
 
12
12
  //////////// CONFIG ENV ///////////////
13
13
  const API_CONFIG = require('./webpack.api.js');
14
- const cliConfig = require('./cli.config.js');
15
14
  let CLI_CONFIG = {};
16
15
  let existsCli= fs.existsSync('./cli.config.js');
17
16
  if(existsCli){
@@ -32,7 +31,7 @@ console.log(`=====================env end=========================`);
32
31
  const devMode = process.env.build_env !== 'prod';
33
32
  const hashMode = CLI_CONFIG?.hashMode ?? process.env.build_env != 'localdebug';
34
33
  const cssSplitMode = CLI_CONFIG?.cssSplitMode??true;
35
- const resource_path_relative='';
34
+ const resource_path_relative= CLI_CONFIG?.site_root_path??'';
36
35
  const support_sass=CLI_CONFIG?.sass??false;
37
36
  const css_modules= CLI_CONFIG?.cssModule??'local';
38
37
  const jsSplitMode = CLI_CONFIG?.jsSplitMode??true;
@@ -51,6 +50,7 @@ if(CLI_CONFIG?.dist){
51
50
  }
52
51
  }
53
52
 
53
+
54
54
  //////////// CONFIG ENV-END ///////////////
55
55
 
56
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -46,10 +46,18 @@ module.exports = {
46
46
  sass:true,//默认:false,true=开启sass支持,默认仅支持less
47
47
  indexHtml:false,//默认:true,false=关闭index.html的注入
48
48
  projectSourceFolder:'./',//默认:'./public',项目源代码文件夹所在位置,默认是'src'
49
+ site_root_path:'',//默认:'',站点根目录,
50
+ // dist:'dist',// 默认:'dist',编译后文件输出目录
51
+ // dist:{// 可详细配置相应资源的输出目录
52
+ // base:'',
53
+ // js:'',//js输出的目录
54
+ // }
49
55
  };
50
56
  ```
51
57
 
52
58
  # 更新日志
59
+ * 1.0.20
60
+ 1. cli.config.js增加配置site_root_path,用于设置站点根目录
53
61
 
54
62
  * 1.0.19
55
63
  1. 对splitChunks内runtime的cli配置支持