@flatjs/evolve 1.8.1-next.65 → 1.8.1-next.67

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/constants.js +17 -1
  3. package/dist/create-webpack/create-externals.js +6 -1
  4. package/dist/create-webpack/create-optimization.js +29 -1
  5. package/dist/create-webpack/create-output.js +35 -1
  6. package/dist/create-webpack/create-performance.js +7 -1
  7. package/dist/create-webpack/create-plugins.js +78 -1
  8. package/dist/create-webpack/create-resolve.js +31 -1
  9. package/dist/create-webpack/create-rule-sets.js +16 -1
  10. package/dist/create-webpack/load-webpack-config.js +55 -1
  11. package/dist/create-webpack/rule-sets/constants.js +3 -1
  12. package/dist/create-webpack/rule-sets/rule-assets.js +44 -1
  13. package/dist/create-webpack/rule-sets/rule-css.js +84 -1
  14. package/dist/create-webpack/rule-sets/rule-less.js +45 -1
  15. package/dist/create-webpack/rule-sets/rule-scripts.js +27 -1
  16. package/dist/create-webpack/rule-sets/rule-svg-icon.js +25 -1
  17. package/dist/create-webpack/rule-sets/rule-utils.js +10 -1
  18. package/dist/create-webpack/types.js +1 -1
  19. package/dist/default-options.js +79 -1
  20. package/dist/define-config/define-config.js +4 -1
  21. package/dist/define-config/index.js +1 -1
  22. package/dist/dev-server/add-compiler-to-dev-server.js +47 -1
  23. package/dist/dev-server/create-app-page-route.js +11 -1
  24. package/dist/dev-server/create-dev-server-compiler-tasks.js +51 -1
  25. package/dist/dev-server/create-dev-server-entries.js +27 -1
  26. package/dist/dev-server/create-dev-server.js +23 -1
  27. package/dist/dev-server/index.js +6 -1
  28. package/dist/dev-server/middlewares/create-page-middleware.js +164 -1
  29. package/dist/dev-server/middlewares/create-public-assets-middleware.js +25 -1
  30. package/dist/dev-server/middlewares/index.js +2 -1
  31. package/dist/errors/evolve-build-error.js +10 -1
  32. package/dist/helpers/allow-px2rem-for-module.js +6 -1
  33. package/dist/helpers/assert-only-single-entry-item.js +23 -1
  34. package/dist/helpers/chunk-entry-map.js +21 -1
  35. package/dist/helpers/enable-bundle-hashname-for-module.js +6 -1
  36. package/dist/helpers/filter-actived-entries.d.ts +1 -1
  37. package/dist/helpers/filter-actived-entries.js +41 -1
  38. package/dist/helpers/get-bundle-file-name.js +23 -1
  39. package/dist/helpers/get-git-root.js +4 -1
  40. package/dist/helpers/get-html-plugin-config.d.ts +9 -1
  41. package/dist/helpers/get-html-plugin-config.js +47 -1
  42. package/dist/helpers/get-max-process-tasks.d.ts +1 -0
  43. package/dist/helpers/get-max-process-tasks.js +7 -0
  44. package/dist/helpers/get-pacakge-dir.js +13 -1
  45. package/dist/helpers/index.js +15 -1
  46. package/dist/helpers/merge-babel-options.js +45 -1
  47. package/dist/helpers/normalize-entry-map.js +38 -1
  48. package/dist/helpers/open-page.js +15 -1
  49. package/dist/helpers/print-log.js +49 -1
  50. package/dist/helpers/refresh-evolve-mock-options.js +23 -1
  51. package/dist/helpers/resolve-entry-map-input-files.js +20 -1
  52. package/dist/helpers/script-injects.js +39 -1
  53. package/dist/helpers/should-enable-react-fast-refresh.js +8 -1
  54. package/dist/helpers/split-to-multi-compiler.js +22 -1
  55. package/dist/index.js +5 -1
  56. package/dist/load-config/index.js +1 -1
  57. package/dist/load-config/load-evolve-config.js +35 -1
  58. package/dist/main/env-verify.js +21 -1
  59. package/dist/main/index.js +4 -1
  60. package/dist/main/prepare-build.d.ts +4 -8
  61. package/dist/main/prepare-build.js +38 -1
  62. package/dist/main/prepare-serve.js +36 -1
  63. package/dist/main/prepare-static.js +28 -1
  64. package/dist/main/start-build-dynamic.d.ts +2 -1
  65. package/dist/main/start-build-dynamic.js +144 -1
  66. package/dist/main/start-build-worker.d.ts +14 -0
  67. package/dist/main/start-build-worker.js +41 -0
  68. package/dist/main/start-build.d.ts +1 -8
  69. package/dist/main/start-build.js +49 -1
  70. package/dist/main/start-one-entry-build.d.ts +13 -0
  71. package/dist/main/start-one-entry-build.js +35 -0
  72. package/dist/main/start-serve.js +32 -1
  73. package/dist/main/start-static.js +16 -1
  74. package/dist/minimizer/create-minimizers.js +25 -1
  75. package/dist/minimizer/default-options.js +14 -1
  76. package/dist/minimizer/image-minimizer.js +56 -1
  77. package/dist/minimizer/index.js +1 -1
  78. package/dist/minimizer/terser-minimizer.js +15 -3
  79. package/dist/minimizer/types.js +1 -1
  80. package/dist/plugins/clean-webpack/clean-webpack-plugin.js +173 -1
  81. package/dist/plugins/clean-webpack/index.js +22 -1
  82. package/dist/plugins/define-variable/define-variable-plugin.js +21 -1
  83. package/dist/plugins/define-variable/index.js +1 -1
  84. package/dist/plugins/html-inject-scripts/plugin-html-inject-script.js +27 -1
  85. package/dist/plugins/module-federation/external-template-remotes.js +92 -1
  86. package/dist/plugins/module-federation/index.js +1 -1
  87. package/dist/plugins/module-federation/module-federation.js +98 -1
  88. package/dist/plugins/multi-html/index.js +15 -1
  89. package/dist/plugins/multi-html/multi-html-cdn-plugin.js +84 -1
  90. package/dist/plugins/multi-html/multi-html-plugin.js +70 -1
  91. package/dist/types/index.js +8 -1
  92. package/dist/types/types-ci.js +1 -1
  93. package/dist/types/types-dev-server.js +1 -1
  94. package/dist/types/types-entry-map.js +1 -1
  95. package/dist/types/types-federation.js +1 -1
  96. package/dist/types/types-loader-options.js +1 -1
  97. package/dist/types/types-modular-import.js +1 -1
  98. package/dist/types/types-multi-html.d.ts +6 -5
  99. package/dist/types/types-multi-html.js +1 -1
  100. package/dist/types/types-options.js +1 -1
  101. package/dist/types/types-plugin-options.js +1 -1
  102. package/dist/types/types-webpack.d.ts +1 -1
  103. package/dist/types/types-webpack.js +1 -1
  104. package/package.json +14 -12
  105. package/templates/html-plugin/index-dev.html +31 -38
  106. package/templates/html-plugin/index-inte.html +31 -38
  107. package/templates/html-plugin/index-inte2.html +31 -38
  108. package/templates/html-plugin/index-inte3.html +31 -38
  109. package/templates/html-plugin/index-inte4.html +31 -38
  110. package/templates/html-plugin/index-me.html +31 -38
  111. package/templates/html-plugin/index-prod.html +31 -38
  112. package/templates/html-plugin/index-rc.html +31 -38
  113. package/templates/html-plugin/index-uat.html +31 -38
  114. package/templates/module.html +40 -55
@@ -17,48 +17,41 @@
17
17
  />
18
18
  <title><%= title %></title>
19
19
 
20
- <% if (headBeforeHtmlTags) { %>
21
- <% for (let index = 0; index < headBeforeHtmlTags.length; index++) { %>
22
- <%= headBeforeHtmlTags[index] %>
23
- <% } %>
24
- <% } %>
25
-
26
- <% if (inlineScripts) { %>
27
- <script>
28
- <% for (let index = 0; index < inlineScripts.length; index++) { %>
29
- <%= inlineScripts[index] %>
30
- <% } %>
31
- </script>
32
- <% } %>
33
-
34
- <% if (viewport) { %>
35
- <script><%= viewport %></script>
36
- <% } %>
37
-
38
- <% if (favicon) { %>
39
- <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
40
- <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
41
- <% } %>
42
-
43
- <% if (headBeforeStyles) { %>
44
- <% for (let index = 0; index < headBeforeStyles.length; index++) { %>
45
- <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
46
- <% } %>
47
- <% } %>
48
-
49
- <% if (headBeforeScripts) { %>
50
- <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
51
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
20
+ <% if (headBeforeHtmlTags) { %> <% for (let index = 0; index <
21
+ headBeforeHtmlTags.length; index++) { %> <%= headBeforeHtmlTags[index] %> <%
22
+ } %> <% } %> <% if (inlineScripts) { %>
23
+ <script>
24
+ <% for (let index = 0; index < inlineScripts.length; index++) { %>
25
+ <%= inlineScripts[index] %>
52
26
  <% } %>
53
- <% } %>
27
+ </script>
28
+ <% } %> <% if (viewport) { %>
29
+ <script>
30
+ <%= viewport %>
31
+ </script>
32
+ <% } %> <% if (favicon) { %>
33
+ <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
34
+ <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
35
+ <% } %> <% if (headBeforeStyles) { %> <% for (let index = 0; index <
36
+ headBeforeStyles.length; index++) { %>
37
+ <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
38
+ <% } %> <% } %> <% if (headBeforeScripts) { %> <% for (let index = 0; index
39
+ < headBeforeScripts.length; index++) { %>
40
+ <script
41
+ crossorigin="anonymous"
42
+ src="<%= headBeforeScripts[index]%>"
43
+ ></script>
44
+ <% } %> <% } %>
54
45
  </head>
55
46
 
56
47
  <body>
57
48
  <div id="app"></div>
58
- <% if (bodyAfterScripts) { %>
59
- <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
60
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
61
- <% } %>
62
- <% } %>
49
+ <% if (bodyAfterScripts) { %> <% for (let index = 0; index <
50
+ bodyAfterScripts.length; index++) { %>
51
+ <script
52
+ crossorigin="anonymous"
53
+ src="<%= bodyAfterScripts[index]%>"
54
+ ></script>
55
+ <% } %> <% } %>
63
56
  </body>
64
57
  </html>
@@ -17,48 +17,41 @@
17
17
  />
18
18
  <title><%= title %></title>
19
19
 
20
- <% if (headBeforeHtmlTags) { %>
21
- <% for (let index = 0; index < headBeforeHtmlTags.length; index++) { %>
22
- <%= headBeforeHtmlTags[index] %>
23
- <% } %>
24
- <% } %>
25
-
26
- <% if (inlineScripts) { %>
27
- <script>
28
- <% for (let index = 0; index < inlineScripts.length; index++) { %>
29
- <%= inlineScripts[index] %>
30
- <% } %>
31
- </script>
32
- <% } %>
33
-
34
- <% if (viewport) { %>
35
- <script><%= viewport %></script>
36
- <% } %>
37
-
38
- <% if (favicon) { %>
39
- <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
40
- <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
41
- <% } %>
42
-
43
- <% if (headBeforeStyles) { %>
44
- <% for (let index = 0; index < headBeforeStyles.length; index++) { %>
45
- <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
46
- <% } %>
47
- <% } %>
48
-
49
- <% if (headBeforeScripts) { %>
50
- <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
51
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
20
+ <% if (headBeforeHtmlTags) { %> <% for (let index = 0; index <
21
+ headBeforeHtmlTags.length; index++) { %> <%= headBeforeHtmlTags[index] %> <%
22
+ } %> <% } %> <% if (inlineScripts) { %>
23
+ <script>
24
+ <% for (let index = 0; index < inlineScripts.length; index++) { %>
25
+ <%= inlineScripts[index] %>
52
26
  <% } %>
53
- <% } %>
27
+ </script>
28
+ <% } %> <% if (viewport) { %>
29
+ <script>
30
+ <%= viewport %>
31
+ </script>
32
+ <% } %> <% if (favicon) { %>
33
+ <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
34
+ <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
35
+ <% } %> <% if (headBeforeStyles) { %> <% for (let index = 0; index <
36
+ headBeforeStyles.length; index++) { %>
37
+ <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
38
+ <% } %> <% } %> <% if (headBeforeScripts) { %> <% for (let index = 0; index
39
+ < headBeforeScripts.length; index++) { %>
40
+ <script
41
+ crossorigin="anonymous"
42
+ src="<%= headBeforeScripts[index]%>"
43
+ ></script>
44
+ <% } %> <% } %>
54
45
  </head>
55
46
 
56
47
  <body>
57
48
  <div id="app"></div>
58
- <% if (bodyAfterScripts) { %>
59
- <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
60
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
61
- <% } %>
62
- <% } %>
49
+ <% if (bodyAfterScripts) { %> <% for (let index = 0; index <
50
+ bodyAfterScripts.length; index++) { %>
51
+ <script
52
+ crossorigin="anonymous"
53
+ src="<%= bodyAfterScripts[index]%>"
54
+ ></script>
55
+ <% } %> <% } %>
63
56
  </body>
64
57
  </html>
@@ -17,48 +17,41 @@
17
17
  />
18
18
  <title><%= title %></title>
19
19
 
20
- <% if (headBeforeHtmlTags) { %>
21
- <% for (let index = 0; index < headBeforeHtmlTags.length; index++) { %>
22
- <%= headBeforeHtmlTags[index] %>
23
- <% } %>
24
- <% } %>
25
-
26
- <% if (inlineScripts) { %>
27
- <script>
28
- <% for (let index = 0; index < inlineScripts.length; index++) { %>
29
- <%= inlineScripts[index] %>
30
- <% } %>
31
- </script>
32
- <% } %>
33
-
34
- <% if (viewport) { %>
35
- <script><%= viewport %></script>
36
- <% } %>
37
-
38
- <% if (favicon) { %>
39
- <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
40
- <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
41
- <% } %>
42
-
43
- <% if (headBeforeStyles) { %>
44
- <% for (let index = 0; index < headBeforeStyles.length; index++) { %>
45
- <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
46
- <% } %>
47
- <% } %>
48
-
49
- <% if (headBeforeScripts) { %>
50
- <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
51
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
20
+ <% if (headBeforeHtmlTags) { %> <% for (let index = 0; index <
21
+ headBeforeHtmlTags.length; index++) { %> <%= headBeforeHtmlTags[index] %> <%
22
+ } %> <% } %> <% if (inlineScripts) { %>
23
+ <script>
24
+ <% for (let index = 0; index < inlineScripts.length; index++) { %>
25
+ <%= inlineScripts[index] %>
52
26
  <% } %>
53
- <% } %>
27
+ </script>
28
+ <% } %> <% if (viewport) { %>
29
+ <script>
30
+ <%= viewport %>
31
+ </script>
32
+ <% } %> <% if (favicon) { %>
33
+ <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
34
+ <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
35
+ <% } %> <% if (headBeforeStyles) { %> <% for (let index = 0; index <
36
+ headBeforeStyles.length; index++) { %>
37
+ <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
38
+ <% } %> <% } %> <% if (headBeforeScripts) { %> <% for (let index = 0; index
39
+ < headBeforeScripts.length; index++) { %>
40
+ <script
41
+ crossorigin="anonymous"
42
+ src="<%= headBeforeScripts[index]%>"
43
+ ></script>
44
+ <% } %> <% } %>
54
45
  </head>
55
46
 
56
47
  <body>
57
48
  <div id="app"></div>
58
- <% if (bodyAfterScripts) { %>
59
- <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
60
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
61
- <% } %>
62
- <% } %>
49
+ <% if (bodyAfterScripts) { %> <% for (let index = 0; index <
50
+ bodyAfterScripts.length; index++) { %>
51
+ <script
52
+ crossorigin="anonymous"
53
+ src="<%= bodyAfterScripts[index]%>"
54
+ ></script>
55
+ <% } %> <% } %>
63
56
  </body>
64
57
  </html>
@@ -17,70 +17,55 @@
17
17
  />
18
18
  <title><%= title %></title>
19
19
 
20
- <% if (headBeforeHtmlTags) { %>
21
- <% for (let index = 0; index < headBeforeHtmlTags.length; index++) { %>
22
- <%= headBeforeHtmlTags[index] %>
23
- <% } %>
24
- <% } %>
25
-
26
- <% if (inlineScripts) { %>
27
- <script>
28
- <% for (let index = 0; index < inlineScripts.length; index++) { %>
29
- <%= inlineScripts[index] %>
30
- <% } %>
31
- </script>
32
- <% } %>
33
-
34
- <% if (viewport) { %>
35
- <script><%= viewport %></script>
36
- <% } %>
37
-
38
- <% if (favicon) { %>
39
- <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
40
- <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
41
- <% } %>
42
-
43
- <% if (headBeforeStyles) { %>
44
- <% for (let index = 0; index < headBeforeStyles.length; index++) { %>
45
- <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
46
- <% } %>
47
- <% } %>
20
+ <% if (headBeforeHtmlTags) { %> <% for (let index = 0; index <
21
+ headBeforeHtmlTags.length; index++) { %> <%= headBeforeHtmlTags[index] %> <%
22
+ } %> <% } %> <% if (inlineScripts) { %>
23
+ <script>
24
+ <% for (let index = 0; index < inlineScripts.length; index++) { %>
25
+ <%= inlineScripts[index] %>
26
+ <% } %>
27
+ </script>
28
+ <% } %> <% if (viewport) { %>
29
+ <script>
30
+ <%= viewport %>
31
+ </script>
32
+ <% } %> <% if (favicon) { %>
33
+ <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
34
+ <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
35
+ <% } %> <% if (headBeforeStyles) { %> <% for (let index = 0; index <
36
+ headBeforeStyles.length; index++) { %>
37
+ <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
38
+ <% } %> <% } %> <% if (styles.length) { %> <% _.forEach(styles, (css)=> { %>
39
+ <link href="<%= css %>" rel="stylesheet" />
40
+ <% }) %> <% } %>
48
41
 
49
- <% if (styles.length) { %>
50
- <% _.forEach(styles, (css)=> { %>
51
- <link href="<%= css %>" rel="stylesheet" />
52
- <% }) %>
53
- <% } %>
54
-
55
42
  <script>
56
43
  window.GLOBAL = <%= JSON.stringify(Object.assign(global, {})) %>;
57
44
  </script>
58
45
 
59
- <% if (headBeforeScripts) { %>
60
- <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
61
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
62
- <% } %>
63
- <% } %>
46
+ <% if (headBeforeScripts) { %> <% for (let index = 0; index <
47
+ headBeforeScripts.length; index++) { %>
48
+ <script
49
+ crossorigin="anonymous"
50
+ src="<%= headBeforeScripts[index]%>"
51
+ ></script>
52
+ <% } %> <% } %>
64
53
  </head>
65
54
 
66
55
  <body>
67
56
  <div id="app"></div>
68
57
  <% if (moduleFederationScripts.length) { %>
69
- <script>
70
- <%= moduleFederationScripts %>
71
- </script>
72
- <% } %>
73
-
74
- <% if (scripts.length) { %>
75
- <% _.forEach(scripts, (js)=> { %>
76
- <script src="<%= js %>"></script>
77
- <% }) %>
78
- <% } %>
79
-
80
- <% if (bodyAfterScripts) { %>
81
- <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
82
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
83
- <% } %>
84
- <% } %>
58
+ <script>
59
+ <%= moduleFederationScripts %>
60
+ </script>
61
+ <% } %> <% if (scripts.length) { %> <% _.forEach(scripts, (js)=> { %>
62
+ <script src="<%= js %>"></script>
63
+ <% }) %> <% } %> <% if (bodyAfterScripts) { %> <% for (let index = 0; index
64
+ < bodyAfterScripts.length; index++) { %>
65
+ <script
66
+ crossorigin="anonymous"
67
+ src="<%= bodyAfterScripts[index]%>"
68
+ ></script>
69
+ <% } %> <% } %>
85
70
  </body>
86
71
  </html>