kn-cli 1.0.68 → 1.0.70

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.
@@ -14,6 +14,7 @@ const NowDateTime = Date.now();
14
14
 
15
15
  //////////// CONFIG ENV ///////////////
16
16
  const API_CONFIG = require('./webpack.api.js');
17
+ const cliConfig = require('./cli.config.js');
17
18
  let CLI_CONFIG = {};
18
19
  let existsCli= fs.existsSync('./cli.config.js');
19
20
  if(existsCli){
@@ -42,6 +43,8 @@ const indexHtml = CLI_CONFIG?.indexHtml ?? true;
42
43
  const https= CLI_CONFIG?.https ?? false;
43
44
  const appVersion= CLI_CONFIG?.version ?? '';
44
45
  const devServer=CLI_CONFIG?.devServer??{};
46
+ const prject_name = CLI_CONFIG?.name??'';
47
+ const sourceMapLocal = CLI_CONFIG?.sourcemap?.local??false;//是否将soucemap改为本地
45
48
 
46
49
  let distFolder = 'dist';
47
50
  let distJsFolder='';
@@ -360,12 +363,22 @@ const plugins= [
360
363
  PM_TYPE: JSON.stringify(process.env.pm_type),
361
364
  APP_VERSION:JSON.stringify(appVersion)
362
365
  }),
363
- new webpack.SourceMapDevToolPlugin({
366
+
367
+ ];
368
+ if(devMode){
369
+ plugins.push(new webpack.SourceMapDevToolPlugin({
364
370
  filename: 'sourcemap/[file].map',
365
371
  // publicPath: '..',//resource_path_relative,
366
372
  // fileContext: 'js',
367
- })
368
- ];
373
+ }))
374
+ }else{
375
+ plugins.push(new webpack.SourceMapDevToolPlugin({
376
+ filename: 'sourcemap/[file].map',
377
+ publicPath: sourceMapLocal?'':`http://192.168.90.250:9970/${prject_name}/`,//resource_path_relative,
378
+ // fileContext: 'js',
379
+ }))
380
+ }
381
+
369
382
 
370
383
 
371
384
  if(indexHtml){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -79,6 +79,9 @@ module.exports = {
79
79
  // port:8080,
80
80
  // useLocalIp:false,//是否使用本地IP地址代替localhost
81
81
  // }
82
+ // sourcemap:{
83
+ // local:true //将生产环境的sourcemap部署到生产本地
84
+ // }
82
85
  };
83
86
  ```
84
87
 
@@ -92,6 +95,13 @@ module.exports = {
92
95
 
93
96
 
94
97
  # 更新日志
98
+
99
+ * 1.0.70
100
+ cli.config增加sourcemap{local:true}的可选配置,用来将sourcemap部署到生产本地
101
+
102
+ * 1.0.69
103
+ 默认生产环境不输出sourcemap
104
+
95
105
  * 1.0.68
96
106
  1. 更新readme
97
107
  2. 增加`kn-cli --tool`功能,用来创建需要的辅助工具
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ **/package-lock.json
3
+ **/.DS_Store
4
+ **/dist
5
+ **/release
6
+
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ **/package-lock.json
3
+ **/.DS_Store
4
+ **/dist
5
+ **/release
6
+
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ **/package-lock.json
3
+ **/.DS_Store
4
+ **/dist
5
+ **/release
6
+
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ **/package-lock.json
3
+ **/.DS_Store
4
+ **/dist
5
+ **/release
6
+
@@ -0,0 +1,6 @@
1
+ **/node_modules
2
+ **/package-lock.json
3
+ **/.DS_Store
4
+ **/dist
5
+ **/release
6
+