kn-cli 1.0.69 → 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.
- package/build/webpack.config.js +10 -0
- package/package.json +1 -1
- package/readme.md +7 -0
package/build/webpack.config.js
CHANGED
|
@@ -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='';
|
|
@@ -368,9 +371,16 @@ if(devMode){
|
|
|
368
371
|
// publicPath: '..',//resource_path_relative,
|
|
369
372
|
// fileContext: 'js',
|
|
370
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
|
+
}))
|
|
371
380
|
}
|
|
372
381
|
|
|
373
382
|
|
|
383
|
+
|
|
374
384
|
if(indexHtml){
|
|
375
385
|
const shareJs = jsSplitMode?['react-bundle', 'modules-bundle', 'default-bundle', 'styles-bundle','kn-hooks']:[];
|
|
376
386
|
if(jsSplitMode===true || jsSplitMode?.runtime !== false){
|
package/package.json
CHANGED
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,10 @@ module.exports = {
|
|
|
92
95
|
|
|
93
96
|
|
|
94
97
|
# 更新日志
|
|
98
|
+
|
|
99
|
+
* 1.0.70
|
|
100
|
+
cli.config增加sourcemap{local:true}的可选配置,用来将sourcemap部署到生产本地
|
|
101
|
+
|
|
95
102
|
* 1.0.69
|
|
96
103
|
默认生产环境不输出sourcemap
|
|
97
104
|
|