@modern-js/app-tools 2.30.1-alpha.0 → 2.31.1

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.
Files changed (272) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/cjs/analyze/getHtmlTemplate.js +6 -0
  3. package/dist/cjs/analyze/nestedRoutes.js +1 -2
  4. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +13 -3
  5. package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +64 -82
  6. package/dist/cjs/config/default.js +2 -1
  7. package/dist/cjs/schema/index.js +3 -0
  8. package/dist/cjs/types/config/testing.js +4 -0
  9. package/dist/cjs/types/legacyConfig/testing.js +4 -0
  10. package/dist/esm/analyze/getHtmlTemplate.js +8 -1
  11. package/dist/esm/analyze/nestedRoutes.js +1 -4
  12. package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +13 -3
  13. package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +189 -249
  14. package/dist/esm/config/default.js +2 -1
  15. package/dist/esm/schema/index.js +3 -0
  16. package/dist/esm/types/config/testing.js +1 -0
  17. package/dist/esm/types/legacyConfig/testing.js +1 -0
  18. package/dist/esm-node/analyze/getHtmlTemplate.js +6 -0
  19. package/dist/esm-node/analyze/nestedRoutes.js +1 -2
  20. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +13 -3
  21. package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +68 -85
  22. package/dist/esm-node/config/default.js +2 -1
  23. package/dist/esm-node/schema/index.js +3 -0
  24. package/dist/esm-node/types/config/testing.js +1 -0
  25. package/dist/esm-node/types/legacyConfig/testing.js +1 -0
  26. package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +24 -0
  27. package/dist/types/types/config/index.d.ts +4 -1
  28. package/dist/types/types/config/output.d.ts +1 -0
  29. package/dist/types/types/config/security.d.ts +3 -1
  30. package/dist/types/types/config/testing.d.ts +8 -0
  31. package/dist/types/types/config/tools.d.ts +1 -1
  32. package/dist/types/types/legacyConfig/index.d.ts +2 -0
  33. package/dist/types/types/legacyConfig/testing.d.ts +8 -0
  34. package/dist/types/types/legacyConfig/tools.d.ts +1 -2
  35. package/package.json +25 -25
  36. package/dist/js/modern/analyze/constants.js +0 -54
  37. package/dist/js/modern/analyze/generateCode.js +0 -247
  38. package/dist/js/modern/analyze/getBundleEntry.js +0 -71
  39. package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +0 -220
  40. package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +0 -216
  41. package/dist/js/modern/analyze/getClientRoutes/index.js +0 -6
  42. package/dist/js/modern/analyze/getClientRoutes/utils.js +0 -31
  43. package/dist/js/modern/analyze/getFileSystemEntry.js +0 -109
  44. package/dist/js/modern/analyze/getHtmlTemplate.js +0 -115
  45. package/dist/js/modern/analyze/getServerRoutes.js +0 -175
  46. package/dist/js/modern/analyze/index.js +0 -332
  47. package/dist/js/modern/analyze/isDefaultExportFunction.js +0 -42
  48. package/dist/js/modern/analyze/makeLegalIdentifier.js +0 -13
  49. package/dist/js/modern/analyze/nestedRoutes.js +0 -157
  50. package/dist/js/modern/analyze/templates.js +0 -334
  51. package/dist/js/modern/analyze/utils.js +0 -141
  52. package/dist/js/modern/builder/builderPlugins/compatModern.js +0 -233
  53. package/dist/js/modern/builder/index.js +0 -159
  54. package/dist/js/modern/builder/loaders/routerLoader.js +0 -17
  55. package/dist/js/modern/builder/loaders/serverModuleLoader.js +0 -7
  56. package/dist/js/modern/builder/share.js +0 -46
  57. package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -30
  58. package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +0 -37
  59. package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +0 -113
  60. package/dist/js/modern/commands/build.js +0 -91
  61. package/dist/js/modern/commands/deploy.js +0 -28
  62. package/dist/js/modern/commands/dev.js +0 -109
  63. package/dist/js/modern/commands/index.js +0 -3
  64. package/dist/js/modern/commands/inspect.js +0 -38
  65. package/dist/js/modern/commands/serve.js +0 -54
  66. package/dist/js/modern/config/default.js +0 -175
  67. package/dist/js/modern/config/index.js +0 -8
  68. package/dist/js/modern/config/initial/createHtmlConfig.js +0 -35
  69. package/dist/js/modern/config/initial/createOutputConfig.js +0 -68
  70. package/dist/js/modern/config/initial/createSourceConfig.js +0 -39
  71. package/dist/js/modern/config/initial/createToolsConfig.js +0 -42
  72. package/dist/js/modern/config/initial/index.js +0 -16
  73. package/dist/js/modern/config/initial/inits.js +0 -152
  74. package/dist/js/modern/config/initial/transformNormalizedConfig.js +0 -47
  75. package/dist/js/modern/defineConfig.js +0 -27
  76. package/dist/js/modern/exports/server.js +0 -4
  77. package/dist/js/modern/hooks.js +0 -35
  78. package/dist/js/modern/index.js +0 -211
  79. package/dist/js/modern/initialize/index.js +0 -124
  80. package/dist/js/modern/locale/en.js +0 -36
  81. package/dist/js/modern/locale/index.js +0 -9
  82. package/dist/js/modern/locale/zh.js +0 -36
  83. package/dist/js/modern/schema/Schema.js +0 -40
  84. package/dist/js/modern/schema/index.js +0 -88
  85. package/dist/js/modern/schema/legacy.js +0 -148
  86. package/dist/js/modern/types/config/deploy.js +0 -0
  87. package/dist/js/modern/types/config/dev.js +0 -0
  88. package/dist/js/modern/types/config/experiments.js +0 -0
  89. package/dist/js/modern/types/config/html.js +0 -0
  90. package/dist/js/modern/types/config/index.js +0 -1
  91. package/dist/js/modern/types/config/output.js +0 -0
  92. package/dist/js/modern/types/config/performance.js +0 -0
  93. package/dist/js/modern/types/config/security.js +0 -0
  94. package/dist/js/modern/types/config/source.js +0 -0
  95. package/dist/js/modern/types/config/tools.js +0 -0
  96. package/dist/js/modern/types/hooks.js +0 -0
  97. package/dist/js/modern/types/index.js +0 -3
  98. package/dist/js/modern/types/legacyConfig/deploy.js +0 -0
  99. package/dist/js/modern/types/legacyConfig/dev.js +0 -0
  100. package/dist/js/modern/types/legacyConfig/index.js +0 -0
  101. package/dist/js/modern/types/legacyConfig/output.js +0 -0
  102. package/dist/js/modern/types/legacyConfig/source.js +0 -0
  103. package/dist/js/modern/types/legacyConfig/tools.js +0 -0
  104. package/dist/js/modern/utils/config.js +0 -128
  105. package/dist/js/modern/utils/createServer.js +0 -75
  106. package/dist/js/modern/utils/env.js +0 -15
  107. package/dist/js/modern/utils/generateWatchFiles.js +0 -55
  108. package/dist/js/modern/utils/getSelectedEntries.js +0 -58
  109. package/dist/js/modern/utils/getServerInternalPlugins.js +0 -58
  110. package/dist/js/modern/utils/language.js +0 -8
  111. package/dist/js/modern/utils/printInstructions.js +0 -31
  112. package/dist/js/modern/utils/restart.js +0 -44
  113. package/dist/js/modern/utils/routes.js +0 -30
  114. package/dist/js/modern/utils/types.js +0 -0
  115. package/dist/js/node/analyze/constants.js +0 -98
  116. package/dist/js/node/analyze/generateCode.js +0 -271
  117. package/dist/js/node/analyze/getBundleEntry.js +0 -95
  118. package/dist/js/node/analyze/getClientRoutes/getRoutes.js +0 -242
  119. package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +0 -238
  120. package/dist/js/node/analyze/getClientRoutes/index.js +0 -30
  121. package/dist/js/node/analyze/getClientRoutes/utils.js +0 -58
  122. package/dist/js/node/analyze/getFileSystemEntry.js +0 -131
  123. package/dist/js/node/analyze/getHtmlTemplate.js +0 -144
  124. package/dist/js/node/analyze/getServerRoutes.js +0 -194
  125. package/dist/js/node/analyze/index.js +0 -339
  126. package/dist/js/node/analyze/isDefaultExportFunction.js +0 -71
  127. package/dist/js/node/analyze/makeLegalIdentifier.js +0 -36
  128. package/dist/js/node/analyze/nestedRoutes.js +0 -184
  129. package/dist/js/node/analyze/templates.js +0 -365
  130. package/dist/js/node/analyze/utils.js +0 -172
  131. package/dist/js/node/builder/builderPlugins/compatModern.js +0 -258
  132. package/dist/js/node/builder/index.js +0 -177
  133. package/dist/js/node/builder/loaders/routerLoader.js +0 -38
  134. package/dist/js/node/builder/loaders/serverModuleLoader.js +0 -28
  135. package/dist/js/node/builder/share.js +0 -75
  136. package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -53
  137. package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +0 -60
  138. package/dist/js/node/builder/webpackPlugins/routerPlugin.js +0 -135
  139. package/dist/js/node/commands/build.js +0 -112
  140. package/dist/js/node/commands/deploy.js +0 -51
  141. package/dist/js/node/commands/dev.js +0 -126
  142. package/dist/js/node/commands/index.js +0 -19
  143. package/dist/js/node/commands/inspect.js +0 -61
  144. package/dist/js/node/commands/serve.js +0 -83
  145. package/dist/js/node/config/default.js +0 -197
  146. package/dist/js/node/config/index.js +0 -34
  147. package/dist/js/node/config/initial/createHtmlConfig.js +0 -58
  148. package/dist/js/node/config/initial/createOutputConfig.js +0 -91
  149. package/dist/js/node/config/initial/createSourceConfig.js +0 -62
  150. package/dist/js/node/config/initial/createToolsConfig.js +0 -65
  151. package/dist/js/node/config/initial/index.js +0 -41
  152. package/dist/js/node/config/initial/inits.js +0 -175
  153. package/dist/js/node/config/initial/transformNormalizedConfig.js +0 -70
  154. package/dist/js/node/defineConfig.js +0 -49
  155. package/dist/js/node/exports/server.js +0 -27
  156. package/dist/js/node/hooks.js +0 -54
  157. package/dist/js/node/index.js +0 -235
  158. package/dist/js/node/initialize/index.js +0 -134
  159. package/dist/js/node/locale/en.js +0 -59
  160. package/dist/js/node/locale/index.js +0 -33
  161. package/dist/js/node/locale/zh.js +0 -59
  162. package/dist/js/node/schema/Schema.js +0 -63
  163. package/dist/js/node/schema/index.js +0 -118
  164. package/dist/js/node/schema/legacy.js +0 -169
  165. package/dist/js/node/types/config/deploy.js +0 -15
  166. package/dist/js/node/types/config/dev.js +0 -15
  167. package/dist/js/node/types/config/experiments.js +0 -15
  168. package/dist/js/node/types/config/html.js +0 -15
  169. package/dist/js/node/types/config/index.js +0 -17
  170. package/dist/js/node/types/config/output.js +0 -15
  171. package/dist/js/node/types/config/performance.js +0 -15
  172. package/dist/js/node/types/config/security.js +0 -15
  173. package/dist/js/node/types/config/source.js +0 -15
  174. package/dist/js/node/types/config/tools.js +0 -15
  175. package/dist/js/node/types/hooks.js +0 -15
  176. package/dist/js/node/types/index.js +0 -19
  177. package/dist/js/node/types/legacyConfig/deploy.js +0 -15
  178. package/dist/js/node/types/legacyConfig/dev.js +0 -15
  179. package/dist/js/node/types/legacyConfig/index.js +0 -15
  180. package/dist/js/node/types/legacyConfig/output.js +0 -15
  181. package/dist/js/node/types/legacyConfig/source.js +0 -15
  182. package/dist/js/node/types/legacyConfig/tools.js +0 -15
  183. package/dist/js/node/utils/config.js +0 -153
  184. package/dist/js/node/utils/createServer.js +0 -106
  185. package/dist/js/node/utils/env.js +0 -38
  186. package/dist/js/node/utils/generateWatchFiles.js +0 -85
  187. package/dist/js/node/utils/getSelectedEntries.js +0 -81
  188. package/dist/js/node/utils/getServerInternalPlugins.js +0 -79
  189. package/dist/js/node/utils/language.js +0 -31
  190. package/dist/js/node/utils/printInstructions.js +0 -54
  191. package/dist/js/node/utils/restart.js +0 -67
  192. package/dist/js/node/utils/routes.js +0 -59
  193. package/dist/js/node/utils/types.js +0 -15
  194. package/dist/js/treeshaking/analyze/constants.js +0 -40
  195. package/dist/js/treeshaking/analyze/generateCode.js +0 -485
  196. package/dist/js/treeshaking/analyze/getBundleEntry.js +0 -62
  197. package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +0 -233
  198. package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +0 -231
  199. package/dist/js/treeshaking/analyze/getClientRoutes/index.js +0 -3
  200. package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +0 -23
  201. package/dist/js/treeshaking/analyze/getFileSystemEntry.js +0 -107
  202. package/dist/js/treeshaking/analyze/getHtmlTemplate.js +0 -302
  203. package/dist/js/treeshaking/analyze/getServerRoutes.js +0 -222
  204. package/dist/js/treeshaking/analyze/index.js +0 -697
  205. package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +0 -47
  206. package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +0 -13
  207. package/dist/js/treeshaking/analyze/nestedRoutes.js +0 -384
  208. package/dist/js/treeshaking/analyze/templates.js +0 -468
  209. package/dist/js/treeshaking/analyze/utils.js +0 -374
  210. package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +0 -304
  211. package/dist/js/treeshaking/builder/index.js +0 -374
  212. package/dist/js/treeshaking/builder/loaders/routerLoader.js +0 -13
  213. package/dist/js/treeshaking/builder/loaders/serverModuleLoader.js +0 -5
  214. package/dist/js/treeshaking/builder/share.js +0 -40
  215. package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -110
  216. package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +0 -72
  217. package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +0 -343
  218. package/dist/js/treeshaking/commands/build.js +0 -291
  219. package/dist/js/treeshaking/commands/deploy.js +0 -154
  220. package/dist/js/treeshaking/commands/dev.js +0 -301
  221. package/dist/js/treeshaking/commands/index.js +0 -3
  222. package/dist/js/treeshaking/commands/inspect.js +0 -149
  223. package/dist/js/treeshaking/commands/serve.js +0 -199
  224. package/dist/js/treeshaking/config/default.js +0 -210
  225. package/dist/js/treeshaking/config/index.js +0 -3
  226. package/dist/js/treeshaking/config/initial/createHtmlConfig.js +0 -19
  227. package/dist/js/treeshaking/config/initial/createOutputConfig.js +0 -41
  228. package/dist/js/treeshaking/config/initial/createSourceConfig.js +0 -42
  229. package/dist/js/treeshaking/config/initial/createToolsConfig.js +0 -23
  230. package/dist/js/treeshaking/config/initial/index.js +0 -12
  231. package/dist/js/treeshaking/config/initial/inits.js +0 -209
  232. package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +0 -35
  233. package/dist/js/treeshaking/defineConfig.js +0 -61
  234. package/dist/js/treeshaking/exports/server.js +0 -2
  235. package/dist/js/treeshaking/hooks.js +0 -29
  236. package/dist/js/treeshaking/index.js +0 -706
  237. package/dist/js/treeshaking/initialize/index.js +0 -276
  238. package/dist/js/treeshaking/locale/en.js +0 -38
  239. package/dist/js/treeshaking/locale/index.js +0 -9
  240. package/dist/js/treeshaking/locale/zh.js +0 -38
  241. package/dist/js/treeshaking/schema/Schema.js +0 -273
  242. package/dist/js/treeshaking/schema/index.js +0 -181
  243. package/dist/js/treeshaking/schema/legacy.js +0 -337
  244. package/dist/js/treeshaking/types/config/deploy.js +0 -1
  245. package/dist/js/treeshaking/types/config/dev.js +0 -1
  246. package/dist/js/treeshaking/types/config/experiments.js +0 -1
  247. package/dist/js/treeshaking/types/config/html.js +0 -1
  248. package/dist/js/treeshaking/types/config/index.js +0 -1
  249. package/dist/js/treeshaking/types/config/output.js +0 -1
  250. package/dist/js/treeshaking/types/config/performance.js +0 -1
  251. package/dist/js/treeshaking/types/config/security.js +0 -1
  252. package/dist/js/treeshaking/types/config/source.js +0 -1
  253. package/dist/js/treeshaking/types/config/tools.js +0 -1
  254. package/dist/js/treeshaking/types/hooks.js +0 -1
  255. package/dist/js/treeshaking/types/index.js +0 -3
  256. package/dist/js/treeshaking/types/legacyConfig/deploy.js +0 -1
  257. package/dist/js/treeshaking/types/legacyConfig/dev.js +0 -1
  258. package/dist/js/treeshaking/types/legacyConfig/index.js +0 -1
  259. package/dist/js/treeshaking/types/legacyConfig/output.js +0 -1
  260. package/dist/js/treeshaking/types/legacyConfig/source.js +0 -1
  261. package/dist/js/treeshaking/types/legacyConfig/tools.js +0 -1
  262. package/dist/js/treeshaking/utils/config.js +0 -302
  263. package/dist/js/treeshaking/utils/createServer.js +0 -258
  264. package/dist/js/treeshaking/utils/env.js +0 -13
  265. package/dist/js/treeshaking/utils/generateWatchFiles.js +0 -214
  266. package/dist/js/treeshaking/utils/getSelectedEntries.js +0 -186
  267. package/dist/js/treeshaking/utils/getServerInternalPlugins.js +0 -210
  268. package/dist/js/treeshaking/utils/language.js +0 -6
  269. package/dist/js/treeshaking/utils/printInstructions.js +0 -152
  270. package/dist/js/treeshaking/utils/restart.js +0 -187
  271. package/dist/js/treeshaking/utils/routes.js +0 -153
  272. package/dist/js/treeshaking/utils/types.js +0 -1
@@ -1,20 +1,35 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
3
3
  import { _ as _create_class } from "@swc/helpers/_/_create_class";
4
+ import { _ as _define_property } from "@swc/helpers/_/_define_property";
4
5
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
6
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
6
7
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
7
- import { _ as _ts_values } from "@swc/helpers/_/_ts_values";
8
- import path from "path";
8
+ import { createHash } from "crypto";
9
9
  import { mergeWith } from "@modern-js/utils/lodash";
10
10
  import { ROUTE_MANIFEST_FILE } from "@modern-js/utils";
11
11
  import { ROUTE_MANIFEST } from "@modern-js/utils/universal/constants";
12
- import { transform } from "esbuild";
13
12
  var PLUGIN_NAME = "ModernjsRoutePlugin";
13
+ var generateContentHash = function(content) {
14
+ return createHash("md5").update(content).digest("hex").slice(0, 8);
15
+ };
14
16
  export var RouterPlugin = /* @__PURE__ */ function() {
15
17
  "use strict";
16
- function RouterPlugin2() {
18
+ function RouterPlugin2(param) {
19
+ var _param_staticJsDir = param.staticJsDir, staticJsDir = _param_staticJsDir === void 0 ? "static/js" : _param_staticJsDir, HtmlBundlerPlugin = param.HtmlBundlerPlugin, enableInlineRouteManifests = param.enableInlineRouteManifests, _param_disableFilenameHash = param.disableFilenameHash, disableFilenameHash = _param_disableFilenameHash === void 0 ? false : _param_disableFilenameHash, _param_scriptLoading = param.scriptLoading, scriptLoading = _param_scriptLoading === void 0 ? "defer" : _param_scriptLoading, nonce = param.nonce;
17
20
  _class_call_check(this, RouterPlugin2);
21
+ _define_property(this, "HtmlBundlerPlugin", void 0);
22
+ _define_property(this, "enableInlineRouteManifests", void 0);
23
+ _define_property(this, "staticJsDir", void 0);
24
+ _define_property(this, "disableFilenameHash", void 0);
25
+ _define_property(this, "scriptLoading", void 0);
26
+ _define_property(this, "nonce", void 0);
27
+ this.HtmlBundlerPlugin = HtmlBundlerPlugin;
28
+ this.enableInlineRouteManifests = enableInlineRouteManifests;
29
+ this.staticJsDir = staticJsDir;
30
+ this.disableFilenameHash = disableFilenameHash;
31
+ this.scriptLoading = scriptLoading;
32
+ this.nonce = nonce;
18
33
  }
19
34
  _create_class(RouterPlugin2, [
20
35
  {
@@ -65,282 +80,207 @@ export var RouterPlugin = /* @__PURE__ */ function() {
65
80
  }
66
81
  var webpack = compiler.webpack;
67
82
  var Compilation = webpack.Compilation, sources = webpack.sources;
68
- var RawSource = sources.RawSource, SourceMapSource = sources.SourceMapSource;
69
- var normalizePath = function(path2) {
70
- if (!path2.endsWith("/")) {
71
- return "".concat(path2, "/");
83
+ var RawSource = sources.RawSource;
84
+ var normalizePath = function(path) {
85
+ if (!path.endsWith("/")) {
86
+ return "".concat(path, "/");
72
87
  }
73
- return path2;
88
+ return path;
74
89
  };
75
- var chunkToSource = /* @__PURE__ */ new Map();
76
- var chunkToMap = /* @__PURE__ */ new Map();
77
- var minimize = compiler.options.optimization.minimize;
90
+ var chunksToHtmlName = /* @__PURE__ */ new Map();
91
+ var ROUTE_MANIFEST_HOLDER = "route-manifest";
92
+ var placeholder = "<!--<?- ".concat(ROUTE_MANIFEST_HOLDER, " ?>-->");
78
93
  compiler.hooks.thisCompilation.tap(PLUGIN_NAME, function(compilation) {
94
+ _this.HtmlBundlerPlugin.getHooks(compilation).beforeEmit.tapAsync("RouterManifestPlugin", function(data, callback) {
95
+ var outputName = data.outputName;
96
+ var chunks = data.plugin.options.chunks;
97
+ chunksToHtmlName.set(chunks, outputName);
98
+ data.html = data.html.replace("</script>", "</script>".concat(placeholder));
99
+ callback(null, data);
100
+ });
79
101
  var _this1 = _this;
80
102
  compilation.hooks.processAssets.tapPromise({
81
103
  name: PLUGIN_NAME,
82
- stage: Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING
104
+ stage: Compilation.PROCESS_ASSETS_STAGE_REPORT
83
105
  }, /* @__PURE__ */ _async_to_generator(function() {
84
- var stats, _stats_chunks, chunks, namedChunkGroups, entryChunks, entryChunkFiles, entryChunkFileIds, i, file, chunkId, asset, map;
106
+ var _loop, stats, publicPath, _stats_chunks, chunks, namedChunkGroups, routeAssets, prevManifestAsset, prevManifestStr, prevManifest, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, chunkGroup, assets, referenceCssAssets, manifest, entryNames, entryChunks, entryChunkFiles, entryChunkFileIds, i;
85
107
  return _ts_generator(this, function(_state) {
108
+ _loop = function(i2) {
109
+ var entryName = entryNames[i2];
110
+ var file = entryChunkFiles[i2];
111
+ var chunkNames = entryChunks[i2].names;
112
+ var chunkId = entryChunkFileIds[i2];
113
+ var asset = compilation.assets[file];
114
+ if (!asset || !chunkId) {
115
+ return "continue";
116
+ }
117
+ var relatedAssets = {};
118
+ if (entryChunkFiles.length > 1) {
119
+ Object.keys(routeAssets).forEach(function(routeId) {
120
+ var _chunkNames;
121
+ var segments = routeId.split("_");
122
+ var chunkName = segments[0];
123
+ if ((_chunkNames = chunkNames) === null || _chunkNames === void 0 ? void 0 : _chunkNames.includes(chunkName)) {
124
+ relatedAssets[routeId] = routeAssets[routeId];
125
+ }
126
+ });
127
+ } else {
128
+ relatedAssets = routeAssets;
129
+ }
130
+ var manifest2 = {
131
+ routeAssets: relatedAssets
132
+ };
133
+ var injectedContent = "\n ;(function(){\n window.".concat(ROUTE_MANIFEST, " = ").concat(JSON.stringify(manifest2, function(k, v) {
134
+ if ((k === "assets" || k === "referenceCssAssets") && Array.isArray(v)) {
135
+ return v.map(function(item) {
136
+ return item.replace(publicPath, "");
137
+ });
138
+ }
139
+ return v;
140
+ }), ";\n })();\n ");
141
+ var htmlName = void 0;
142
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
143
+ try {
144
+ var _loop2 = function() {
145
+ var _step_value2 = _sliced_to_array(_step2.value, 2), chunks2 = _step_value2[0], name2 = _step_value2[1];
146
+ if (Array.isArray(chunkNames) && Array.isArray(chunks2) && chunkNames.every(function(value, index) {
147
+ return value === chunks2[index];
148
+ })) {
149
+ htmlName = name2;
150
+ return "break";
151
+ }
152
+ };
153
+ for (var _iterator2 = chunksToHtmlName.entries()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
154
+ var _ret = _loop2();
155
+ if (_ret === "break")
156
+ break;
157
+ }
158
+ } catch (err) {
159
+ _didIteratorError2 = true;
160
+ _iteratorError2 = err;
161
+ } finally {
162
+ try {
163
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
164
+ _iterator2.return();
165
+ }
166
+ } finally {
167
+ if (_didIteratorError2) {
168
+ throw _iteratorError2;
169
+ }
170
+ }
171
+ }
172
+ var oldHtml = compilation.assets[htmlName];
173
+ var enableInlineRouteManifests = _this1.enableInlineRouteManifests, disableFilenameHash = _this1.disableFilenameHash, staticJsDir = _this1.staticJsDir, scriptLoading = _this1.scriptLoading, nonce = _this1.nonce;
174
+ var nonceAttr = nonce ? 'nonce="'.concat(nonce, '"') : "";
175
+ if (enableInlineRouteManifests) {
176
+ compilation.updateAsset(
177
+ htmlName,
178
+ new RawSource(oldHtml.source().toString().replace(placeholder, "<script ".concat(nonceAttr, ">").concat(injectedContent, "</script>"))),
179
+ // FIXME: The arguments third of updatgeAsset is a optional function in webpack.
180
+ void 0
181
+ );
182
+ } else {
183
+ var scriptPath = "".concat(staticJsDir, "/").concat(ROUTE_MANIFEST_HOLDER, "-").concat(entryName).concat(disableFilenameHash ? ".js" : ".".concat(generateContentHash(injectedContent), ".js"));
184
+ var scriptUrl = "".concat(publicPath).concat(scriptPath);
185
+ var scriptLoadingAttr = (
186
+ // eslint-disable-next-line no-nested-ternary
187
+ scriptLoading === "defer" ? scriptLoading : scriptLoading === "module" ? 'type="module"' : ""
188
+ );
189
+ var script = "<script ".concat(scriptLoadingAttr, " ").concat(nonceAttr, ' src="').concat(scriptUrl, '"></script>');
190
+ compilation.updateAsset(
191
+ htmlName,
192
+ new RawSource(oldHtml.source().toString().replace(placeholder, script)),
193
+ // FIXME: The arguments third of updatgeAsset is a optional function in webpack.
194
+ void 0
195
+ );
196
+ compilation.emitAsset(scriptPath, new RawSource(injectedContent));
197
+ }
198
+ };
86
199
  stats = compilation.getStats().toJson({
87
200
  all: false,
201
+ publicPath: true,
202
+ assets: true,
88
203
  chunkGroups: true,
89
204
  chunks: true,
90
205
  ids: true
91
206
  });
92
- _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, namedChunkGroups = stats.namedChunkGroups;
207
+ publicPath = stats.publicPath, _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, namedChunkGroups = stats.namedChunkGroups;
208
+ routeAssets = {};
93
209
  if (!namedChunkGroups) {
94
210
  return [
95
211
  2
96
212
  ];
97
213
  }
98
- entryChunks = _this1.getEntryChunks(compilation, chunks);
99
- entryChunkFiles = entryChunks.map(function(chunk) {
100
- return _to_consumable_array(chunk.files || []).find(function(fname) {
101
- return fname.includes(".js");
102
- });
103
- });
104
- entryChunkFileIds = entryChunks.map(function(chunk) {
105
- return chunk.id;
214
+ prevManifestAsset = compilation.getAsset(ROUTE_MANIFEST_FILE);
215
+ prevManifestStr = prevManifestAsset ? prevManifestAsset.source.source().toString() : JSON.stringify({
216
+ routeAssets: {}
106
217
  });
107
- for (i = 0; i <= entryChunkFiles.length - 1; i++) {
108
- file = entryChunkFiles[i];
109
- chunkId = entryChunkFileIds[i];
110
- asset = compilation.assets[file];
111
- if (!asset) {
112
- continue;
218
+ prevManifest = JSON.parse(prevManifestStr);
219
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
220
+ try {
221
+ for (_iterator = Object.entries(namedChunkGroups)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
222
+ _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], chunkGroup = _step_value[1];
223
+ assets = chunkGroup.assets.map(function(asset) {
224
+ var filename = asset.name;
225
+ return publicPath ? normalizePath(publicPath) + filename : filename;
226
+ });
227
+ referenceCssAssets = assets.filter(function(asset) {
228
+ return /\.css$/.test(asset);
229
+ });
230
+ routeAssets[name] = {
231
+ chunkIds: chunkGroup.chunks,
232
+ assets: assets,
233
+ referenceCssAssets: referenceCssAssets
234
+ };
235
+ if (prevManifest.routeAssets[name]) {
236
+ mergeWith(routeAssets[name], prevManifest.routeAssets[name], function(obj, source) {
237
+ if (Array.isArray(obj)) {
238
+ return obj.concat(source);
239
+ }
240
+ return Object.assign(source, obj);
241
+ });
242
+ }
243
+ }
244
+ } catch (err) {
245
+ _didIteratorError = true;
246
+ _iteratorError = err;
247
+ } finally {
248
+ try {
249
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
250
+ _iterator.return();
251
+ }
252
+ } finally {
253
+ if (_didIteratorError) {
254
+ throw _iteratorError;
255
+ }
113
256
  }
114
- map = asset.sourceAndMap().map;
115
- chunkToMap.set(chunkId, map);
116
- }
117
- return [
118
- 2
119
- ];
120
- });
121
- }));
122
- var _this2 = _this;
123
- compilation.hooks.processAssets.tapPromise({
124
- name: PLUGIN_NAME,
125
- stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
126
- }, /* @__PURE__ */ _async_to_generator(function() {
127
- var stats, _stats_chunks, chunks, namedChunkGroups, entryChunks, entryChunkFiles, entryChunkFileIds, i, file, chunkId, asset, source;
128
- return _ts_generator(this, function(_state) {
129
- stats = compilation.getStats().toJson({
130
- all: false,
131
- chunkGroups: true,
132
- chunks: true,
133
- ids: true
134
- });
135
- _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, namedChunkGroups = stats.namedChunkGroups;
136
- if (!namedChunkGroups) {
137
- return [
138
- 2
139
- ];
140
257
  }
141
- entryChunks = _this2.getEntryChunks(compilation, chunks);
142
- entryChunkFiles = entryChunks.map(function(chunk) {
143
- return _to_consumable_array(chunk.files || []).find(function(fname) {
144
- return fname.includes(".js");
145
- });
146
- });
258
+ manifest = {
259
+ routeAssets: routeAssets
260
+ };
261
+ entryNames = Array.from(compilation.entrypoints.keys());
262
+ entryChunks = _this1.getEntryChunks(compilation, chunks);
263
+ entryChunkFiles = _this1.getEntryChunkFiles(entryChunks);
147
264
  entryChunkFileIds = entryChunks.map(function(chunk) {
148
265
  return chunk.id;
149
266
  });
150
- for (i = 0; i <= entryChunkFiles.length - 1; i++) {
151
- file = entryChunkFiles[i];
152
- chunkId = entryChunkFileIds[i];
153
- asset = compilation.assets[file];
154
- if (!asset) {
155
- continue;
156
- }
157
- source = asset.sourceAndMap().source;
158
- chunkToSource.set(chunkId, source);
267
+ for (i = 0; i < entryChunkFiles.length; i++)
268
+ _loop(i);
269
+ if (prevManifestAsset) {
270
+ compilation.updateAsset(
271
+ ROUTE_MANIFEST_FILE,
272
+ new RawSource(JSON.stringify(manifest, null, 2)),
273
+ // FIXME: The arguments third of updatgeAsset is a optional function in webpack.
274
+ void 0
275
+ );
276
+ } else {
277
+ compilation.emitAsset(ROUTE_MANIFEST_FILE, new RawSource(JSON.stringify(manifest, null, 2)));
159
278
  }
160
279
  return [
161
280
  2
162
281
  ];
163
282
  });
164
283
  }));
165
- var _this3 = _this;
166
- compilation.hooks.processAssets.tapPromise({
167
- name: PLUGIN_NAME,
168
- stage: Compilation.PROCESS_ASSETS_STAGE_REPORT
169
- }, /* @__PURE__ */ _async_to_generator(function() {
170
- var _loop, stats, publicPath, _stats_chunks, chunks, namedChunkGroups, routeAssets, prevManifestAsset, prevManifestStr, prevManifest, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, name, chunkGroup, assets, referenceCssAssets, manifest, entryChunks, entryChunkFiles, entryChunkFileIds, i;
171
- return _ts_generator(this, function(_state) {
172
- switch (_state.label) {
173
- case 0:
174
- _loop = function(i2) {
175
- var _source, _source1, file, chunkNames, chunkId, asset, relatedAssets, manifest2, injectedContent, source, map, newContent, result, newSource;
176
- return _ts_generator(this, function(_state2) {
177
- switch (_state2.label) {
178
- case 0:
179
- file = entryChunkFiles[i2];
180
- chunkNames = entryChunks[i2].names;
181
- chunkId = entryChunkFileIds[i2];
182
- asset = compilation.assets[file];
183
- if (!asset || !chunkId) {
184
- return [
185
- 2,
186
- "continue"
187
- ];
188
- }
189
- relatedAssets = {};
190
- if (entryChunkFiles.length > 1) {
191
- Object.keys(routeAssets).forEach(function(routeId) {
192
- var _chunkNames;
193
- var segments = routeId.split("_");
194
- var chunkName = segments[0];
195
- if ((_chunkNames = chunkNames) === null || _chunkNames === void 0 ? void 0 : _chunkNames.includes(chunkName)) {
196
- relatedAssets[routeId] = routeAssets[routeId];
197
- }
198
- });
199
- } else {
200
- relatedAssets = routeAssets;
201
- }
202
- manifest2 = {
203
- routeAssets: relatedAssets
204
- };
205
- injectedContent = "\n ;(function(){\n window.".concat(ROUTE_MANIFEST, " = ").concat(JSON.stringify(manifest2, function(k, v) {
206
- if ((k === "assets" || k === "referenceCssAssets") && Array.isArray(v)) {
207
- return v.map(function(item) {
208
- return item.replace(publicPath, "");
209
- });
210
- }
211
- return v;
212
- }), ";\n })();\n ");
213
- source = chunkToSource.get(chunkId);
214
- map = chunkToMap.get(chunkId);
215
- newContent = "".concat(injectedContent).concat((_source = source) === null || _source === void 0 ? void 0 : _source.toString());
216
- return [
217
- 4,
218
- transform(newContent, {
219
- loader: path.extname(file).slice(1),
220
- sourcemap: true,
221
- minify: minimize
222
- })
223
- ];
224
- case 1:
225
- result = _state2.sent();
226
- newSource = new SourceMapSource(result.code, file, result.map, (_source1 = source) === null || _source1 === void 0 ? void 0 : _source1.toString(), map);
227
- compilation.updateAsset(
228
- file,
229
- newSource,
230
- // FIXME: The arguments third of updatgeAsset is a optional function in webpack.
231
- void 0
232
- );
233
- return [
234
- 2
235
- ];
236
- }
237
- });
238
- };
239
- stats = compilation.getStats().toJson({
240
- all: false,
241
- publicPath: true,
242
- assets: true,
243
- chunkGroups: true,
244
- chunks: true,
245
- ids: true
246
- });
247
- publicPath = stats.publicPath, _stats_chunks = stats.chunks, chunks = _stats_chunks === void 0 ? [] : _stats_chunks, namedChunkGroups = stats.namedChunkGroups;
248
- routeAssets = {};
249
- if (!namedChunkGroups) {
250
- return [
251
- 2
252
- ];
253
- }
254
- prevManifestAsset = compilation.getAsset(ROUTE_MANIFEST_FILE);
255
- prevManifestStr = prevManifestAsset ? prevManifestAsset.source.source().toString() : JSON.stringify({
256
- routeAssets: {}
257
- });
258
- prevManifest = JSON.parse(prevManifestStr);
259
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
260
- try {
261
- for (_iterator = Object.entries(namedChunkGroups)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
262
- _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], chunkGroup = _step_value[1];
263
- assets = chunkGroup.assets.map(function(asset) {
264
- var filename = asset.name;
265
- return publicPath ? normalizePath(publicPath) + filename : filename;
266
- });
267
- referenceCssAssets = assets.filter(function(asset) {
268
- return /\.css$/.test(asset);
269
- });
270
- routeAssets[name] = {
271
- chunkIds: chunkGroup.chunks,
272
- assets: assets,
273
- referenceCssAssets: referenceCssAssets
274
- };
275
- if (prevManifest.routeAssets[name]) {
276
- mergeWith(routeAssets[name], prevManifest.routeAssets[name], function(obj, source) {
277
- if (Array.isArray(obj)) {
278
- return obj.concat(source);
279
- }
280
- return Object.assign(source, obj);
281
- });
282
- }
283
- }
284
- } catch (err) {
285
- _didIteratorError = true;
286
- _iteratorError = err;
287
- } finally {
288
- try {
289
- if (!_iteratorNormalCompletion && _iterator.return != null) {
290
- _iterator.return();
291
- }
292
- } finally {
293
- if (_didIteratorError) {
294
- throw _iteratorError;
295
- }
296
- }
297
- }
298
- manifest = {
299
- routeAssets: routeAssets
300
- };
301
- entryChunks = _this3.getEntryChunks(compilation, chunks);
302
- entryChunkFiles = _this3.getEntryChunkFiles(entryChunks);
303
- entryChunkFileIds = entryChunks.map(function(chunk) {
304
- return chunk.id;
305
- });
306
- i = 0;
307
- _state.label = 1;
308
- case 1:
309
- if (!(i < entryChunkFiles.length))
310
- return [
311
- 3,
312
- 4
313
- ];
314
- return [
315
- 5,
316
- _ts_values(_loop(i))
317
- ];
318
- case 2:
319
- _state.sent();
320
- _state.label = 3;
321
- case 3:
322
- i++;
323
- return [
324
- 3,
325
- 1
326
- ];
327
- case 4:
328
- if (prevManifestAsset) {
329
- compilation.updateAsset(
330
- ROUTE_MANIFEST_FILE,
331
- new RawSource(JSON.stringify(manifest, null, 2)),
332
- // FIXME: The arguments third of updatgeAsset is a optional function in webpack.
333
- void 0
334
- );
335
- } else {
336
- compilation.emitAsset(ROUTE_MANIFEST_FILE, new RawSource(JSON.stringify(manifest, null, 2)));
337
- }
338
- return [
339
- 2
340
- ];
341
- }
342
- });
343
- }));
344
284
  });
345
285
  }
346
286
  }
@@ -12,7 +12,8 @@ export function createDefaultConfig(appContext, bundler) {
12
12
  port: void 0
13
13
  });
14
14
  var output = _object_spread_props(_object_spread({}, defaultBuilderConfig.output), {
15
- disableNodePolyfill: true
15
+ disableNodePolyfill: true,
16
+ enableInlineRouteManifests: true
16
17
  });
17
18
  var _obj;
18
19
  var source = _object_spread_props(_object_spread({}, defaultBuilderConfig.source), {
@@ -86,6 +86,9 @@ var output = {
86
86
  },
87
87
  disableNodePolyfill: {
88
88
  type: "boolean"
89
+ },
90
+ enableInlineRouteManifests: {
91
+ type: "boolean"
89
92
  }
90
93
  };
91
94
  var dev = {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -26,6 +26,7 @@ export const getHtmlTemplate = async (entrypoints, api, { appContext, config })
26
26
  const { source: { configDir } } = config;
27
27
  const htmlDir = path.resolve(appDirectory, configDir || "", HTML_PARTIALS_FOLDER);
28
28
  const htmlTemplates = {};
29
+ const partialsByEntrypoint = {};
29
30
  for (const entrypoint of entrypoints) {
30
31
  const { entryName, isMainEntry } = entrypoint;
31
32
  const name = entrypoints.length === 1 && isMainEntry ? "" : entryName;
@@ -55,11 +56,16 @@ export const getHtmlTemplate = async (entrypoints, api, { appContext, config })
55
56
  const templatePath = path.resolve(internalDirectory, entryName, "index.html");
56
57
  fs.outputFileSync(templatePath, templates.html(partials), "utf8");
57
58
  htmlTemplates[entryName] = templatePath;
59
+ partialsByEntrypoint[entryName] = partials;
58
60
  const bottomTemplate = findPartials(htmlDir, name, PartialPosition.BOTTOM);
59
61
  if (bottomTemplate) {
60
62
  htmlTemplates[`__${entryName}-bottom__`] = bottomTemplate.content;
61
63
  }
62
64
  }
63
65
  }
66
+ api.setAppContext({
67
+ ...api.useAppContext(),
68
+ partialsByEntrypoint
69
+ });
64
70
  return htmlTemplates;
65
71
  };
@@ -43,8 +43,7 @@ export const optimizeRoute = (routeTree) => {
43
43
  ];
44
44
  }
45
45
  const { children } = routeTree;
46
- const hasPage = children.some((child) => child.index);
47
- if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config && !hasPage) {
46
+ if (!routeTree._component && !routeTree.error && !routeTree.loading && !routeTree.config) {
48
47
  const newRoutes = children.map((child) => {
49
48
  const routePath = `${routeTree.path ? routeTree.path : ""}${child.path ? `/${child.path}` : ""}`;
50
49
  const newRoute = {
@@ -20,7 +20,7 @@ export const builderPluginAdapterSSR = (options) => ({
20
20
  api.modifyBundlerChain(async (chain, { target, CHAIN_ID, isProd, HtmlPlugin: HtmlBundlerPlugin, isServer }) => {
21
21
  const builderConfig = api.getNormalizedConfig();
22
22
  const { normalizedConfig: normalizedConfig2 } = options;
23
- applyRouterPlugin(chain, options);
23
+ applyRouterPlugin(chain, options, HtmlBundlerPlugin);
24
24
  if (isSSR(normalizedConfig2)) {
25
25
  await applySSRLoaderEntry(chain, options, isServer);
26
26
  applySSRDataLoader(chain, options);
@@ -69,7 +69,7 @@ function applyAsyncChunkHtmlPlugin({ chain, modernConfig, CHAIN_ID, HtmlBundlerP
69
69
  ]);
70
70
  }
71
71
  }
72
- function applyRouterPlugin(chain, options) {
72
+ function applyRouterPlugin(chain, options, HtmlBundlerPlugin) {
73
73
  var _normalizedConfig_runtime, _normalizedConfig, _routerConfig, _normalizedConfig_deploy_worker;
74
74
  const { appContext, normalizedConfig } = options;
75
75
  const { entrypoints } = appContext;
@@ -78,7 +78,17 @@ function applyRouterPlugin(chain, options) {
78
78
  const routerManifest = Boolean((_routerConfig = routerConfig) === null || _routerConfig === void 0 ? void 0 : _routerConfig.manifest);
79
79
  const workerSSR = Boolean((_normalizedConfig_deploy_worker = normalizedConfig.deploy.worker) === null || _normalizedConfig_deploy_worker === void 0 ? void 0 : _normalizedConfig_deploy_worker.ssr);
80
80
  if (existNestedRoutes || routerManifest || workerSSR) {
81
- chain.plugin("route-plugin").use(RouterPlugin);
81
+ var _normalizedConfig_output_distPath, _normalizedConfig_output, _normalizedConfig_output1, _normalizedConfig_html, _normalizedConfig_security;
82
+ chain.plugin("route-plugin").use(RouterPlugin, [
83
+ {
84
+ HtmlBundlerPlugin,
85
+ enableInlineRouteManifests: normalizedConfig.output.enableInlineRouteManifests,
86
+ staticJsDir: (_normalizedConfig_output = normalizedConfig.output) === null || _normalizedConfig_output === void 0 ? void 0 : (_normalizedConfig_output_distPath = _normalizedConfig_output.distPath) === null || _normalizedConfig_output_distPath === void 0 ? void 0 : _normalizedConfig_output_distPath.js,
87
+ disableFilenameHash: (_normalizedConfig_output1 = normalizedConfig.output) === null || _normalizedConfig_output1 === void 0 ? void 0 : _normalizedConfig_output1.disableFilenameHash,
88
+ scriptLoading: (_normalizedConfig_html = normalizedConfig.html) === null || _normalizedConfig_html === void 0 ? void 0 : _normalizedConfig_html.scriptLoading,
89
+ nonce: (_normalizedConfig_security = normalizedConfig.security) === null || _normalizedConfig_security === void 0 ? void 0 : _normalizedConfig_security.nonce
90
+ }
91
+ ]);
82
92
  }
83
93
  }
84
94
  function applyFilterEntriesBySSRConfig({ isProd, chain, appNormalizedConfig }) {