kn-cli 1.0.27 → 1.0.29

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.
@@ -38,6 +38,8 @@ const resource_path_relative= CLI_CONFIG?.site_root_path??'';
38
38
  const support_sass=CLI_CONFIG?.sass??false;
39
39
  const css_modules= CLI_CONFIG?.cssModule??'local';
40
40
  const jsSplitMode = CLI_CONFIG?.jsSplitMode??true;
41
+ const indexHtml = CLI_CONFIG?.indexHtml ?? true;
42
+
41
43
  let distFolder = 'dist';
42
44
  let distJsFolder='';
43
45
  if(CLI_CONFIG?.dist){
@@ -308,9 +310,11 @@ const optimization= {
308
310
  };
309
311
  if(jsSplitMode){
310
312
  if(jsSplitMode===true||jsSplitMode?.runtime!==false){
311
- optimization.runtimeChunk= {
312
- name: 'runtime', // 所有入口有自己的runtime.js
313
- };
313
+ if(indexHtml){//只有当会注入到html内时才允许带runtime,避免多entry情况下入口js变为chunk.js
314
+ optimization.runtimeChunk= {
315
+ name: 'runtime', // 所有入口有自己的runtime.js
316
+ };
317
+ }
314
318
  }
315
319
  optimization.splitChunks= {
316
320
  cacheGroups: {
@@ -373,7 +377,7 @@ const plugins= [
373
377
  })
374
378
  ];
375
379
 
376
- const indexHtml = CLI_CONFIG?.indexHtml ?? true;
380
+
377
381
  if(indexHtml){
378
382
  const shareJs = jsSplitMode?['react-bundle', 'modules-bundle', 'default-bundle', 'styles-bundle']:[];
379
383
  if(jsSplitMode===true || jsSplitMode?.runtime !== false){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -63,6 +63,12 @@ module.exports = {
63
63
  ```
64
64
 
65
65
  # 更新日志
66
+ * 1.0.29
67
+ 1. 修复因多entry情况下,生成runtime会导致入口js变为chunk的问题
68
+
69
+ * 1.0.28
70
+ 1. chunkFileName命名
71
+
66
72
  * 1.0.27
67
73
  1. 更新模板
68
74