kn-cli 1.0.116 → 1.0.118

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.
@@ -20,6 +20,7 @@
20
20
  "@babel/plugin-proposal-optional-chaining": "~7.8.3",
21
21
  "@babel/plugin-proposal-private-methods": "~7.8.3",
22
22
  "@babel/plugin-transform-runtime": "7.5.0",
23
+ "@babel/plugin-transform-regenerator": "~7.27.5",
23
24
  "@babel/polyfill": "~7.8.7",
24
25
  "@babel/preset-env": "7.7.7",
25
26
  "@babel/preset-react": "~7.8.3",
@@ -40,7 +40,7 @@ warn(`=====================env end=========================`);
40
40
  const build_log_level=process.env.build_log_level || 'clear';
41
41
  const devMode = process.env.build_env !== 'prod';
42
42
  const hashMode = CLI_CONFIG?.hashMode ?? process.env.build_env != 'localdebug';
43
- const cssSplitMode = CLI_CONFIG?.cssSplitMode??true;
43
+ const cssSplitMode = CLI_CONFIG?.cssSplitMode??(process.env.build_env == 'localdebug'?false:true);
44
44
  const resource_path_relative= CLI_CONFIG?.site_root_path??'';
45
45
  const support_sass=CLI_CONFIG?.sass??false;
46
46
  const css_modules= CLI_CONFIG?.cssModule??'local';
@@ -52,6 +52,13 @@ const devServer=CLI_CONFIG?.devServer??{};
52
52
  const prject_name = CLI_CONFIG?.name??'';
53
53
  const sourceMapLocal = CLI_CONFIG?.sourcemap?.local??false;//是否将soucemap改为本地
54
54
 
55
+ warn(`=====================env-webpack=========================`);
56
+ warn(`devMode:${devMode}`);
57
+ warn(`hashMode:${hashMode}`);
58
+ warn(`cssSplitMode:${cssSplitMode}`);
59
+ warn(`sourceMapLocal:${sourceMapLocal}`);
60
+ warn(`=====================env-webpack end=========================`);
61
+
55
62
  let distFolder = 'dist';
56
63
  let distJsFolder='';
57
64
  if(CLI_CONFIG?.dist){
@@ -385,6 +392,10 @@ if(devMode){
385
392
  }
386
393
  plugins.push(new webpack.SourceMapDevToolPlugin({
387
394
  filename: 'sourcemap/[file].map',
395
+ // filename: false, // 避免生成额外的 .map 文件,提高构建速度
396
+ // module: true, // 使 source map 映射到 loader 处理前的源码
397
+ // columns: false, // 只映射到行,忽略列信息,提高性能
398
+ // lineToLine: false, // 关闭逐行映射,减少计算量
388
399
  // publicPath: '..',//resource_path_relative,
389
400
  // fileContext: 'js',
390
401
  }))
@@ -523,6 +534,10 @@ const config={
523
534
  },
524
535
  optimization: optimization,
525
536
  plugins: plugins,
537
+ // watchOptions: {
538
+ // aggregateTimeout: 5000, // 文件变化后延迟 300 毫秒再重新构建
539
+ // ignored: /node_modules/ // 忽略 node_modules 目录
540
+ // }
526
541
  };
527
542
 
528
543
  if(process.env.build_env == 'localdebug'){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {