@modern-js/app-tools 2.9.0 → 2.10.1-alpha.0
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/CHANGELOG.md +56 -0
- package/dist/cjs/analyze/generateCode.js +3 -1
- package/dist/cjs/analyze/index.js +8 -0
- package/dist/cjs/analyze/templates.js +45 -13
- package/dist/cjs/builder/builder-rspack/index.js +22 -1
- package/dist/cjs/builder/index.js +3 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +6 -3
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +14 -3
- package/dist/cjs/commands/serve.js +9 -2
- package/dist/esm/analyze/generateCode.js +3 -2
- package/dist/esm/analyze/index.js +8 -0
- package/dist/esm/analyze/templates.js +53 -15
- package/dist/esm/builder/builder-rspack/index.js +169 -1
- package/dist/esm/builder/index.js +15 -8
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +10 -3
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +15 -4
- package/dist/esm/commands/serve.js +59 -2
- package/dist/esm-node/analyze/generateCode.js +3 -1
- package/dist/esm-node/analyze/index.js +8 -0
- package/dist/esm-node/analyze/templates.js +45 -13
- package/dist/esm-node/builder/builder-rspack/index.js +12 -1
- package/dist/esm-node/builder/index.js +3 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +7 -4
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +15 -9
- package/dist/esm-node/commands/serve.js +9 -2
- package/dist/js/modern/analyze/constants.js +54 -0
- package/dist/js/modern/analyze/generateCode.js +247 -0
- package/dist/js/modern/analyze/getBundleEntry.js +71 -0
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +220 -0
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +216 -0
- package/dist/js/modern/analyze/getClientRoutes/index.js +6 -0
- package/dist/js/modern/analyze/getClientRoutes/utils.js +31 -0
- package/dist/js/modern/analyze/getFileSystemEntry.js +109 -0
- package/dist/js/modern/analyze/getHtmlTemplate.js +115 -0
- package/dist/js/modern/analyze/getServerRoutes.js +175 -0
- package/dist/js/modern/analyze/index.js +332 -0
- package/dist/js/modern/analyze/isDefaultExportFunction.js +42 -0
- package/dist/js/modern/analyze/makeLegalIdentifier.js +13 -0
- package/dist/js/modern/analyze/nestedRoutes.js +157 -0
- package/dist/js/modern/analyze/templates.js +334 -0
- package/dist/js/modern/analyze/utils.js +141 -0
- package/dist/js/modern/builder/builderPlugins/compatModern.js +233 -0
- package/dist/js/modern/builder/index.js +159 -0
- package/dist/js/modern/builder/loaders/routerLoader.js +17 -0
- package/dist/js/modern/builder/loaders/serverModuleLoader.js +7 -0
- package/dist/js/modern/builder/share.js +46 -0
- package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +30 -0
- package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +37 -0
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +113 -0
- package/dist/js/modern/commands/build.js +91 -0
- package/dist/js/modern/commands/deploy.js +28 -0
- package/dist/js/modern/commands/dev.js +109 -0
- package/dist/js/modern/commands/index.js +3 -0
- package/dist/js/modern/commands/inspect.js +38 -0
- package/dist/js/modern/commands/serve.js +54 -0
- package/dist/js/modern/config/default.js +175 -0
- package/dist/js/modern/config/index.js +8 -0
- package/dist/js/modern/config/initial/createHtmlConfig.js +35 -0
- package/dist/js/modern/config/initial/createOutputConfig.js +68 -0
- package/dist/js/modern/config/initial/createSourceConfig.js +39 -0
- package/dist/js/modern/config/initial/createToolsConfig.js +42 -0
- package/dist/js/modern/config/initial/index.js +16 -0
- package/dist/js/modern/config/initial/inits.js +152 -0
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +47 -0
- package/dist/js/modern/defineConfig.js +27 -0
- package/dist/js/modern/exports/server.js +4 -0
- package/dist/js/modern/hooks.js +35 -0
- package/dist/js/modern/index.js +211 -0
- package/dist/js/modern/initialize/index.js +124 -0
- package/dist/js/modern/locale/en.js +36 -0
- package/dist/js/modern/locale/index.js +9 -0
- package/dist/js/modern/locale/zh.js +36 -0
- package/dist/js/modern/schema/Schema.js +40 -0
- package/dist/js/modern/schema/index.js +88 -0
- package/dist/js/modern/schema/legacy.js +148 -0
- package/dist/js/modern/types/config/deploy.js +0 -0
- package/dist/js/modern/types/config/dev.js +0 -0
- package/dist/js/modern/types/config/experiments.js +0 -0
- package/dist/js/modern/types/config/html.js +0 -0
- package/dist/js/modern/types/config/index.js +1 -0
- package/dist/js/modern/types/config/output.js +0 -0
- package/dist/js/modern/types/config/performance.js +0 -0
- package/dist/js/modern/types/config/security.js +0 -0
- package/dist/js/modern/types/config/source.js +0 -0
- package/dist/js/modern/types/config/tools.js +0 -0
- package/dist/js/modern/types/hooks.js +0 -0
- package/dist/js/modern/types/index.js +3 -0
- package/dist/js/modern/types/legacyConfig/deploy.js +0 -0
- package/dist/js/modern/types/legacyConfig/dev.js +0 -0
- package/dist/js/modern/types/legacyConfig/index.js +0 -0
- package/dist/js/modern/types/legacyConfig/output.js +0 -0
- package/dist/js/modern/types/legacyConfig/source.js +0 -0
- package/dist/js/modern/types/legacyConfig/tools.js +0 -0
- package/dist/js/modern/utils/config.js +128 -0
- package/dist/js/modern/utils/createServer.js +75 -0
- package/dist/js/modern/utils/env.js +15 -0
- package/dist/js/modern/utils/generateWatchFiles.js +55 -0
- package/dist/js/modern/utils/getSelectedEntries.js +58 -0
- package/dist/js/modern/utils/getServerInternalPlugins.js +58 -0
- package/dist/js/modern/utils/language.js +8 -0
- package/dist/js/modern/utils/printInstructions.js +31 -0
- package/dist/js/modern/utils/restart.js +44 -0
- package/dist/js/modern/utils/routes.js +30 -0
- package/dist/js/modern/utils/types.js +0 -0
- package/dist/js/node/analyze/constants.js +98 -0
- package/dist/js/node/analyze/generateCode.js +271 -0
- package/dist/js/node/analyze/getBundleEntry.js +95 -0
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +242 -0
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +238 -0
- package/dist/js/node/analyze/getClientRoutes/index.js +30 -0
- package/dist/js/node/analyze/getClientRoutes/utils.js +58 -0
- package/dist/js/node/analyze/getFileSystemEntry.js +131 -0
- package/dist/js/node/analyze/getHtmlTemplate.js +144 -0
- package/dist/js/node/analyze/getServerRoutes.js +194 -0
- package/dist/js/node/analyze/index.js +339 -0
- package/dist/js/node/analyze/isDefaultExportFunction.js +71 -0
- package/dist/js/node/analyze/makeLegalIdentifier.js +36 -0
- package/dist/js/node/analyze/nestedRoutes.js +184 -0
- package/dist/js/node/analyze/templates.js +365 -0
- package/dist/js/node/analyze/utils.js +172 -0
- package/dist/js/node/builder/builderPlugins/compatModern.js +258 -0
- package/dist/js/node/builder/index.js +177 -0
- package/dist/js/node/builder/loaders/routerLoader.js +38 -0
- package/dist/js/node/builder/loaders/serverModuleLoader.js +28 -0
- package/dist/js/node/builder/share.js +75 -0
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +53 -0
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +60 -0
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +135 -0
- package/dist/js/node/commands/build.js +112 -0
- package/dist/js/node/commands/deploy.js +51 -0
- package/dist/js/node/commands/dev.js +126 -0
- package/dist/js/node/commands/index.js +19 -0
- package/dist/js/node/commands/inspect.js +61 -0
- package/dist/js/node/commands/serve.js +83 -0
- package/dist/js/node/config/default.js +197 -0
- package/dist/js/node/config/index.js +34 -0
- package/dist/js/node/config/initial/createHtmlConfig.js +58 -0
- package/dist/js/node/config/initial/createOutputConfig.js +91 -0
- package/dist/js/node/config/initial/createSourceConfig.js +62 -0
- package/dist/js/node/config/initial/createToolsConfig.js +65 -0
- package/dist/js/node/config/initial/index.js +41 -0
- package/dist/js/node/config/initial/inits.js +175 -0
- package/dist/js/node/config/initial/transformNormalizedConfig.js +70 -0
- package/dist/js/node/defineConfig.js +49 -0
- package/dist/js/node/exports/server.js +27 -0
- package/dist/js/node/hooks.js +54 -0
- package/dist/js/node/index.js +235 -0
- package/dist/js/node/initialize/index.js +134 -0
- package/dist/js/node/locale/en.js +59 -0
- package/dist/js/node/locale/index.js +33 -0
- package/dist/js/node/locale/zh.js +59 -0
- package/dist/js/node/schema/Schema.js +63 -0
- package/dist/js/node/schema/index.js +118 -0
- package/dist/js/node/schema/legacy.js +169 -0
- package/dist/js/node/types/config/deploy.js +15 -0
- package/dist/js/node/types/config/dev.js +15 -0
- package/dist/js/node/types/config/experiments.js +15 -0
- package/dist/js/node/types/config/html.js +15 -0
- package/dist/js/node/types/config/index.js +17 -0
- package/dist/js/node/types/config/output.js +15 -0
- package/dist/js/node/types/config/performance.js +15 -0
- package/dist/js/node/types/config/security.js +15 -0
- package/dist/js/node/types/config/source.js +15 -0
- package/dist/js/node/types/config/tools.js +15 -0
- package/dist/js/node/types/hooks.js +15 -0
- package/dist/js/node/types/index.js +19 -0
- package/dist/js/node/types/legacyConfig/deploy.js +15 -0
- package/dist/js/node/types/legacyConfig/dev.js +15 -0
- package/dist/js/node/types/legacyConfig/index.js +15 -0
- package/dist/js/node/types/legacyConfig/output.js +15 -0
- package/dist/js/node/types/legacyConfig/source.js +15 -0
- package/dist/js/node/types/legacyConfig/tools.js +15 -0
- package/dist/js/node/utils/config.js +153 -0
- package/dist/js/node/utils/createServer.js +106 -0
- package/dist/js/node/utils/env.js +38 -0
- package/dist/js/node/utils/generateWatchFiles.js +85 -0
- package/dist/js/node/utils/getSelectedEntries.js +81 -0
- package/dist/js/node/utils/getServerInternalPlugins.js +79 -0
- package/dist/js/node/utils/language.js +31 -0
- package/dist/js/node/utils/printInstructions.js +54 -0
- package/dist/js/node/utils/restart.js +67 -0
- package/dist/js/node/utils/routes.js +59 -0
- package/dist/js/node/utils/types.js +15 -0
- package/dist/js/treeshaking/analyze/constants.js +40 -0
- package/dist/js/treeshaking/analyze/generateCode.js +485 -0
- package/dist/js/treeshaking/analyze/getBundleEntry.js +62 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +233 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +231 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/index.js +3 -0
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +23 -0
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +107 -0
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +302 -0
- package/dist/js/treeshaking/analyze/getServerRoutes.js +222 -0
- package/dist/js/treeshaking/analyze/index.js +697 -0
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +47 -0
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +13 -0
- package/dist/js/treeshaking/analyze/nestedRoutes.js +384 -0
- package/dist/js/treeshaking/analyze/templates.js +468 -0
- package/dist/js/treeshaking/analyze/utils.js +374 -0
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +304 -0
- package/dist/js/treeshaking/builder/index.js +374 -0
- package/dist/js/treeshaking/builder/loaders/routerLoader.js +13 -0
- package/dist/js/treeshaking/builder/loaders/serverModuleLoader.js +5 -0
- package/dist/js/treeshaking/builder/share.js +40 -0
- package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +110 -0
- package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +72 -0
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +343 -0
- package/dist/js/treeshaking/commands/build.js +291 -0
- package/dist/js/treeshaking/commands/deploy.js +154 -0
- package/dist/js/treeshaking/commands/dev.js +301 -0
- package/dist/js/treeshaking/commands/index.js +3 -0
- package/dist/js/treeshaking/commands/inspect.js +149 -0
- package/dist/js/treeshaking/commands/serve.js +199 -0
- package/dist/js/treeshaking/config/default.js +210 -0
- package/dist/js/treeshaking/config/index.js +3 -0
- package/dist/js/treeshaking/config/initial/createHtmlConfig.js +19 -0
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +41 -0
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +42 -0
- package/dist/js/treeshaking/config/initial/createToolsConfig.js +23 -0
- package/dist/js/treeshaking/config/initial/index.js +12 -0
- package/dist/js/treeshaking/config/initial/inits.js +209 -0
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +35 -0
- package/dist/js/treeshaking/defineConfig.js +61 -0
- package/dist/js/treeshaking/exports/server.js +2 -0
- package/dist/js/treeshaking/hooks.js +29 -0
- package/dist/js/treeshaking/index.js +706 -0
- package/dist/js/treeshaking/initialize/index.js +276 -0
- package/dist/js/treeshaking/locale/en.js +38 -0
- package/dist/js/treeshaking/locale/index.js +9 -0
- package/dist/js/treeshaking/locale/zh.js +38 -0
- package/dist/js/treeshaking/schema/Schema.js +273 -0
- package/dist/js/treeshaking/schema/index.js +181 -0
- package/dist/js/treeshaking/schema/legacy.js +337 -0
- package/dist/js/treeshaking/types/config/deploy.js +1 -0
- package/dist/js/treeshaking/types/config/dev.js +1 -0
- package/dist/js/treeshaking/types/config/experiments.js +1 -0
- package/dist/js/treeshaking/types/config/html.js +1 -0
- package/dist/js/treeshaking/types/config/index.js +1 -0
- package/dist/js/treeshaking/types/config/output.js +1 -0
- package/dist/js/treeshaking/types/config/performance.js +1 -0
- package/dist/js/treeshaking/types/config/security.js +1 -0
- package/dist/js/treeshaking/types/config/source.js +1 -0
- package/dist/js/treeshaking/types/config/tools.js +1 -0
- package/dist/js/treeshaking/types/hooks.js +1 -0
- package/dist/js/treeshaking/types/index.js +3 -0
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/dev.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/index.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/output.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/source.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/tools.js +1 -0
- package/dist/js/treeshaking/utils/config.js +302 -0
- package/dist/js/treeshaking/utils/createServer.js +258 -0
- package/dist/js/treeshaking/utils/env.js +13 -0
- package/dist/js/treeshaking/utils/generateWatchFiles.js +214 -0
- package/dist/js/treeshaking/utils/getSelectedEntries.js +186 -0
- package/dist/js/treeshaking/utils/getServerInternalPlugins.js +210 -0
- package/dist/js/treeshaking/utils/language.js +6 -0
- package/dist/js/treeshaking/utils/printInstructions.js +152 -0
- package/dist/js/treeshaking/utils/restart.js +187 -0
- package/dist/js/treeshaking/utils/routes.js +153 -0
- package/dist/js/treeshaking/utils/types.js +1 -0
- package/dist/types/analyze/templates.d.ts +3 -1
- package/dist/types/builder/builder-rspack/index.d.ts +2 -1
- package/dist/types/types/config/output.d.ts +1 -0
- package/package.json +31 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @modern-js/app-tools
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0da32d0: chore: upgrade jest and puppeteer
|
|
8
|
+
chore: 升级 jest 和 puppeteer 到 latest
|
|
9
|
+
- 0d9962b: fix: add types field in package.json
|
|
10
|
+
fix: 添加 package.json 中的 types 字段
|
|
11
|
+
- fbefa7e: chore(deps): bump webpack from 5.75.0 to 5.76.2
|
|
12
|
+
|
|
13
|
+
chore(deps): 将 webpack 从 5.75.0 升级至 5.76.2
|
|
14
|
+
|
|
15
|
+
- 7b5dd99: feat(app-tools): support builder-plugin-node-polyfill & output.disableNodePolyfill false when use Rspack
|
|
16
|
+
|
|
17
|
+
feat(app-tools): 在启动 Rspack 时,支持 builder-plugin-node-polyfill 插件以及将 output.disableNodePolyfill 设置为 false
|
|
18
|
+
|
|
19
|
+
- 6db4864: feat: add output.splitRouteChunks
|
|
20
|
+
feat: 添加 output.splitRouteChunks 配置
|
|
21
|
+
- dcc5610: perf: improve routerPlugin performance
|
|
22
|
+
perf: 优化 routerPlugin 的性能
|
|
23
|
+
- 84c4372: fix: should get publicPath from webpack stats in router-plugin
|
|
24
|
+
fix: 应该从 webpack stats 获得 publicPath
|
|
25
|
+
- Updated dependencies [d8bbf28]
|
|
26
|
+
- Updated dependencies [a8db932]
|
|
27
|
+
- Updated dependencies [3e0bd50]
|
|
28
|
+
- Updated dependencies [92d247f]
|
|
29
|
+
- Updated dependencies [0da32d0]
|
|
30
|
+
- Updated dependencies [d3f0642]
|
|
31
|
+
- Updated dependencies [a16b9b0]
|
|
32
|
+
- Updated dependencies [0d9962b]
|
|
33
|
+
- Updated dependencies [fbefa7e]
|
|
34
|
+
- Updated dependencies [4d54233]
|
|
35
|
+
- Updated dependencies [6db4864]
|
|
36
|
+
- Updated dependencies [82326ee]
|
|
37
|
+
- Updated dependencies [d6b6e29]
|
|
38
|
+
- Updated dependencies [cfdbf80]
|
|
39
|
+
- Updated dependencies [ed55acb]
|
|
40
|
+
- @modern-js/prod-server@2.10.0
|
|
41
|
+
- @modern-js/builder-webpack-provider@2.10.0
|
|
42
|
+
- @modern-js/builder-rspack-provider@2.10.0
|
|
43
|
+
- @modern-js/builder-shared@2.10.0
|
|
44
|
+
- @modern-js/plugin-data-loader@2.10.0
|
|
45
|
+
- @modern-js/server@2.10.0
|
|
46
|
+
- @modern-js/types@2.10.0
|
|
47
|
+
- @modern-js/node-bundle-require@2.10.0
|
|
48
|
+
- @modern-js/new-action@2.10.0
|
|
49
|
+
- @modern-js/plugin-i18n@2.10.0
|
|
50
|
+
- @modern-js/plugin-lint@2.10.0
|
|
51
|
+
- @modern-js/upgrade@2.10.0
|
|
52
|
+
- @modern-js/plugin@2.10.0
|
|
53
|
+
- @modern-js/utils@2.10.0
|
|
54
|
+
- @modern-js/core@2.10.0
|
|
55
|
+
- @modern-js/builder-plugin-esbuild@2.10.0
|
|
56
|
+
- @modern-js/builder-plugin-node-polyfill@2.10.0
|
|
57
|
+
- @modern-js/builder@2.10.0
|
|
58
|
+
|
|
3
59
|
## 2.9.0
|
|
4
60
|
|
|
5
61
|
### Patch Changes
|
|
@@ -99,6 +99,7 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
|
99
99
|
const getRoutes = isV5 ? import_getClientRoutes.getClientRoutesLegacy : import_getClientRoutes.getClientRoutes;
|
|
100
100
|
await Promise.all(entrypoints.map(generateEntryCode));
|
|
101
101
|
async function generateEntryCode(entrypoint) {
|
|
102
|
+
var _a;
|
|
102
103
|
const { entryName, isAutoMount, customBootstrap, fileSystemRoutes } = entrypoint;
|
|
103
104
|
if (isAutoMount) {
|
|
104
105
|
if (fileSystemRoutes) {
|
|
@@ -161,7 +162,8 @@ const generateCode = async (appContext, config, entrypoints, api) => {
|
|
|
161
162
|
ssrMode: useSSG ? "string" : mode,
|
|
162
163
|
nestedRoutesEntry: entrypoint.nestedRoutesEntry,
|
|
163
164
|
entryName: entrypoint.entryName,
|
|
164
|
-
internalDirectory
|
|
165
|
+
internalDirectory,
|
|
166
|
+
splitRouteChunks: (_a = config2 == null ? void 0 : config2.output) == null ? void 0 : _a.splitRouteChunks
|
|
165
167
|
})
|
|
166
168
|
});
|
|
167
169
|
if (entrypoint.nestedRoutesEntry && (0, import_utils.isUseSSRBundle)(config2)) {
|
|
@@ -247,6 +247,14 @@ var analyze_default = ({
|
|
|
247
247
|
imports
|
|
248
248
|
};
|
|
249
249
|
},
|
|
250
|
+
validateSchema() {
|
|
251
|
+
return {
|
|
252
|
+
target: "output.splitRouteChunks",
|
|
253
|
+
schema: {
|
|
254
|
+
type: "boolean"
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
},
|
|
250
258
|
async fileChange(e) {
|
|
251
259
|
const appContext = api.useAppContext();
|
|
252
260
|
const { appDirectory } = appContext;
|
|
@@ -176,13 +176,16 @@ const routesForServer = ({
|
|
|
176
176
|
${routesCode}
|
|
177
177
|
`;
|
|
178
178
|
};
|
|
179
|
+
const createMatchReg = (keyword) => new RegExp(`("${keyword}":\\s)"([^,]+)"`, "g");
|
|
179
180
|
const fileSystemRoutes = async ({
|
|
180
181
|
routes,
|
|
181
182
|
ssrMode,
|
|
182
183
|
nestedRoutesEntry,
|
|
183
184
|
entryName,
|
|
184
|
-
internalDirectory
|
|
185
|
+
internalDirectory,
|
|
186
|
+
splitRouteChunks = true
|
|
185
187
|
}) => {
|
|
188
|
+
const components = [];
|
|
186
189
|
const loadings = [];
|
|
187
190
|
const errors = [];
|
|
188
191
|
const loaders = [];
|
|
@@ -241,20 +244,30 @@ const fileSystemRoutes = async ({
|
|
|
241
244
|
};
|
|
242
245
|
}
|
|
243
246
|
if (route._component) {
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
if (splitRouteChunks) {
|
|
248
|
+
if (route.isRoot) {
|
|
249
|
+
rootLayoutCode = `import RootLayout from '${route._component}'`;
|
|
250
|
+
component = `RootLayout`;
|
|
251
|
+
} else if (ssrMode === "string") {
|
|
252
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
253
|
+
component = `loadable(${lazyImport})`;
|
|
254
|
+
} else {
|
|
255
|
+
lazyImport = `() => import(/* webpackChunkName: "${route.id}" */ '${route._component}')`;
|
|
256
|
+
component = `lazy(${lazyImport})`;
|
|
257
|
+
}
|
|
250
258
|
} else {
|
|
251
|
-
|
|
252
|
-
component = `
|
|
259
|
+
components.push(route._component);
|
|
260
|
+
component = `component_${components.length - 1}`;
|
|
253
261
|
}
|
|
254
262
|
}
|
|
255
263
|
} else if (route._component) {
|
|
256
|
-
|
|
257
|
-
|
|
264
|
+
if (splitRouteChunks) {
|
|
265
|
+
lazyImport = `() => import('${route._component}')`;
|
|
266
|
+
component = `loadable(${lazyImport})`;
|
|
267
|
+
} else {
|
|
268
|
+
components.push(route._component);
|
|
269
|
+
component = `component_${components.length - 1}`;
|
|
270
|
+
}
|
|
258
271
|
}
|
|
259
272
|
const finalRoute = {
|
|
260
273
|
...route,
|
|
@@ -275,20 +288,38 @@ const fileSystemRoutes = async ({
|
|
|
275
288
|
for (const route of routes) {
|
|
276
289
|
if ("type" in route) {
|
|
277
290
|
const newRoute = traverseRouteTree(route);
|
|
278
|
-
|
|
291
|
+
const routeStr = JSON.stringify(newRoute, null, 2);
|
|
292
|
+
const keywords = [
|
|
293
|
+
"component",
|
|
294
|
+
"lazyImport",
|
|
295
|
+
"loader",
|
|
296
|
+
"loading",
|
|
297
|
+
"error"
|
|
298
|
+
];
|
|
299
|
+
const regs = keywords.map(createMatchReg);
|
|
300
|
+
const newRouteStr = regs.reduce((acc, reg) => acc.replace(reg, "$1$2"), routeStr).replace(/"(RootLayout)"/g, "$1").replace(/\\"/g, '"');
|
|
301
|
+
routeComponentsCode += `${newRouteStr},`;
|
|
279
302
|
} else {
|
|
280
303
|
const component = `loadable(() => import('${route._component}'))`;
|
|
281
304
|
const finalRoute = {
|
|
282
305
|
...route,
|
|
283
306
|
component
|
|
284
307
|
};
|
|
285
|
-
|
|
308
|
+
const keywords = ["component", "lazyImport"];
|
|
309
|
+
const routeStr = JSON.stringify(finalRoute, null, 2);
|
|
310
|
+
const regs = keywords.map(createMatchReg);
|
|
311
|
+
const newRouteStr = regs.reduce((acc, reg) => acc.replace(reg, "$1$2"), routeStr).replace(/\\"/g, '"');
|
|
312
|
+
routeComponentsCode += `${newRouteStr},`;
|
|
286
313
|
}
|
|
287
314
|
}
|
|
288
315
|
routeComponentsCode += `
|
|
289
316
|
];`;
|
|
290
317
|
const importLoadingCode = loadings.map((loading, index2) => {
|
|
291
318
|
return `import loading_${index2} from '${loading}';
|
|
319
|
+
`;
|
|
320
|
+
}).join("");
|
|
321
|
+
const importComponentsCode = components.map((component, index2) => {
|
|
322
|
+
return `import component_${index2} from '${component}';
|
|
292
323
|
`;
|
|
293
324
|
}).join("");
|
|
294
325
|
const importErrorComponentsCode = errors.map((error, index2) => {
|
|
@@ -313,6 +344,7 @@ const fileSystemRoutes = async ({
|
|
|
313
344
|
await import_utils.fs.writeJSON(loadersMapFile, loadersMap);
|
|
314
345
|
return `
|
|
315
346
|
${importLazyCode}
|
|
347
|
+
${importComponentsCode}
|
|
316
348
|
${rootLayoutCode}
|
|
317
349
|
${importLoadingCode}
|
|
318
350
|
${importErrorComponentsCode}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var builder_rspack_exports = {};
|
|
19
29
|
__export(builder_rspack_exports, {
|
|
@@ -23,7 +33,18 @@ module.exports = __toCommonJS(builder_rspack_exports);
|
|
|
23
33
|
var import_builder_rspack_provider = require("@modern-js/builder-rspack-provider");
|
|
24
34
|
var import_generator = require("../generator");
|
|
25
35
|
function createRspackBuilderForModern(options) {
|
|
26
|
-
return (0, import_generator.generateBuilder)(options, import_builder_rspack_provider.builderRspackProvider
|
|
36
|
+
return (0, import_generator.generateBuilder)(options, import_builder_rspack_provider.builderRspackProvider, {
|
|
37
|
+
async modifyBuilderInstance(builder) {
|
|
38
|
+
applyBuilderPlugins(builder, options);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async function applyBuilderPlugins(builder, options) {
|
|
43
|
+
const { normalizedConfig } = options;
|
|
44
|
+
if (!normalizedConfig.output.disableNodePolyfill) {
|
|
45
|
+
const { builderPluginNodePolyfill } = await Promise.resolve().then(() => __toESM(require("@modern-js/builder-plugin-node-polyfill")));
|
|
46
|
+
builder.addPlugins([builderPluginNodePolyfill()]);
|
|
47
|
+
}
|
|
27
48
|
}
|
|
28
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
50
|
0 && (module.exports = {
|
|
@@ -31,11 +31,13 @@ __export(builder_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(builder_exports);
|
|
33
33
|
var import_utils = require("@modern-js/utils");
|
|
34
|
+
var import_builder_rspack_provider = require("@modern-js/builder-rspack-provider");
|
|
34
35
|
async function createBuilderGenerator(bundler) {
|
|
35
36
|
if (bundler === "rspack") {
|
|
36
37
|
try {
|
|
37
38
|
const { createRspackBuilderForModern } = await Promise.resolve().then(() => __toESM(require("./builder-rspack")));
|
|
38
|
-
|
|
39
|
+
const version = await (0, import_builder_rspack_provider.getRspackVersion)();
|
|
40
|
+
import_utils.logger.info(`Using Rspack v${version} 🦀`);
|
|
39
41
|
return createRspackBuilderForModern;
|
|
40
42
|
} catch (_) {
|
|
41
43
|
throw new Error(
|
|
@@ -42,13 +42,16 @@ const builderPluginAdapterSSR = (options) => ({
|
|
|
42
42
|
api.modifyBundlerChain(
|
|
43
43
|
async (chain, { target, CHAIN_ID, isProd, HtmlPlugin: HtmlBundlerPlugin, isServer }) => {
|
|
44
44
|
const builderConfig = api.getNormalizedConfig();
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
const { normalizedConfig: normalizedConfig2 } = options;
|
|
46
|
+
if ((0, import_utils.isSSR)(normalizedConfig2)) {
|
|
47
|
+
applyRouterPlugin(chain, options);
|
|
48
|
+
await applySSRLoaderEntry(chain, options, isServer);
|
|
49
|
+
}
|
|
47
50
|
if (["node", "service-worker"].includes(target)) {
|
|
48
51
|
applyFilterEntriesBySSRConfig({
|
|
49
52
|
isProd,
|
|
50
53
|
chain,
|
|
51
|
-
appNormalizedConfig:
|
|
54
|
+
appNormalizedConfig: normalizedConfig2
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
57
|
if ((0, import_adapterHtml.isHtmlEnabled)(builderConfig, target)) {
|
|
@@ -32,6 +32,8 @@ __export(RouterPlugin_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(RouterPlugin_exports);
|
|
33
33
|
var import_path = __toESM(require("path"));
|
|
34
34
|
var import_utils = require("@modern-js/utils");
|
|
35
|
+
var import_constants = require("@modern-js/utils/constants");
|
|
36
|
+
var import_constants2 = require("@modern-js/utils/universal/constants");
|
|
35
37
|
const PLUGIN_NAME = "ModernjsRoutePlugin";
|
|
36
38
|
class RouterPlugin {
|
|
37
39
|
apply(compiler) {
|
|
@@ -62,8 +64,12 @@ class RouterPlugin {
|
|
|
62
64
|
},
|
|
63
65
|
async () => {
|
|
64
66
|
const stats = compilation.getStats().toJson({
|
|
67
|
+
all: false,
|
|
68
|
+
publicPath: true,
|
|
69
|
+
assets: true,
|
|
65
70
|
chunkGroups: true,
|
|
66
|
-
chunks: true
|
|
71
|
+
chunks: true,
|
|
72
|
+
ids: true
|
|
67
73
|
});
|
|
68
74
|
const { publicPath, chunks = [] } = stats;
|
|
69
75
|
const routeAssets = {};
|
|
@@ -89,7 +95,12 @@ class RouterPlugin {
|
|
|
89
95
|
};
|
|
90
96
|
const injectedContent = `
|
|
91
97
|
;(function(){
|
|
92
|
-
window.${
|
|
98
|
+
window.${import_constants2.ROUTE_MANIFEST} = ${JSON.stringify(manifest, (k, v) => {
|
|
99
|
+
if (k === "assets") {
|
|
100
|
+
return void 0;
|
|
101
|
+
}
|
|
102
|
+
return v;
|
|
103
|
+
})};
|
|
93
104
|
})();
|
|
94
105
|
`;
|
|
95
106
|
const entrypointsArray = Array.from(
|
|
@@ -119,7 +130,7 @@ class RouterPlugin {
|
|
|
119
130
|
void 0
|
|
120
131
|
);
|
|
121
132
|
}
|
|
122
|
-
const filename = import_path.default.join(outputPath,
|
|
133
|
+
const filename = import_path.default.join(outputPath, import_constants.ROUTE_MANIFEST_FILE);
|
|
123
134
|
await import_utils.fs.ensureFile(filename);
|
|
124
135
|
await import_utils.fs.writeFile(filename, JSON.stringify(manifest, null, 2));
|
|
125
136
|
}
|
|
@@ -36,7 +36,7 @@ var import_printInstructions = require("../utils/printInstructions");
|
|
|
36
36
|
var import_createServer = require("../utils/createServer");
|
|
37
37
|
var import_getServerInternalPlugins = require("../utils/getServerInternalPlugins");
|
|
38
38
|
const start = async (api) => {
|
|
39
|
-
var _a;
|
|
39
|
+
var _a, _b;
|
|
40
40
|
const appContext = api.useAppContext();
|
|
41
41
|
const userConfig = api.useResolvedConfigContext();
|
|
42
42
|
const hookRunners = api.useHookRunners();
|
|
@@ -49,7 +49,14 @@ const start = async (api) => {
|
|
|
49
49
|
const serverInternalPlugins = await (0, import_getServerInternalPlugins.getServerInternalPlugins)(api);
|
|
50
50
|
const app = await (0, import_prod_server.default)({
|
|
51
51
|
pwd: appDirectory,
|
|
52
|
-
config:
|
|
52
|
+
config: {
|
|
53
|
+
...userConfig,
|
|
54
|
+
dev: userConfig.dev,
|
|
55
|
+
output: {
|
|
56
|
+
path: (_b = userConfig.output.distPath) == null ? void 0 : _b.root,
|
|
57
|
+
...userConfig.output || {}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
53
60
|
appContext: {
|
|
54
61
|
sharedDirectory: (0, import_utils.getTargetDir)(
|
|
55
62
|
appContext.sharedDirectory,
|
|
@@ -245,7 +245,7 @@ var generateCode = function() {
|
|
|
245
245
|
}
|
|
246
246
|
function _generateEntryCode() {
|
|
247
247
|
_generateEntryCode = _asyncToGenerator(function(entrypoint) {
|
|
248
|
-
var entryName, isAutoMount, customBootstrap, fileSystemRoutes, initialRoutes, nestedRoute, routes, config2, ssr, useSSG, mode, hasPageRoute, _ref, code2, _, _tmp, routesServerFile, code3, serverLoaderCombined, serverLoaderFile, _ref1, importStatements, plugins, _ref2, renderFunction, exportStatement, code, entryFile, _ref3, asyncEntryCode, bootstrapFile;
|
|
248
|
+
var entryName, isAutoMount, customBootstrap, fileSystemRoutes, _config2_output, initialRoutes, nestedRoute, routes, config2, ssr, useSSG, mode, hasPageRoute, _ref, code2, _, _tmp, routesServerFile, code3, serverLoaderCombined, serverLoaderFile, _ref1, importStatements, plugins, _ref2, renderFunction, exportStatement, code, entryFile, _ref3, asyncEntryCode, bootstrapFile;
|
|
249
249
|
return __generator(this, function(_state) {
|
|
250
250
|
switch(_state.label){
|
|
251
251
|
case 0:
|
|
@@ -322,7 +322,8 @@ var generateCode = function() {
|
|
|
322
322
|
ssrMode: useSSG ? "string" : mode,
|
|
323
323
|
nestedRoutesEntry: entrypoint.nestedRoutesEntry,
|
|
324
324
|
entryName: entrypoint.entryName,
|
|
325
|
-
internalDirectory: internalDirectory
|
|
325
|
+
internalDirectory: internalDirectory,
|
|
326
|
+
splitRouteChunks: config2 === null || config2 === void 0 ? void 0 : (_config2_output = config2.output) === null || _config2_output === void 0 ? void 0 : _config2_output.splitRouteChunks
|
|
326
327
|
})
|
|
327
328
|
];
|
|
328
329
|
case 4:
|
|
@@ -638,6 +638,14 @@ var analyze_default = function(param) {
|
|
|
638
638
|
});
|
|
639
639
|
})();
|
|
640
640
|
},
|
|
641
|
+
validateSchema: function validateSchema() {
|
|
642
|
+
return {
|
|
643
|
+
target: "output.splitRouteChunks",
|
|
644
|
+
schema: {
|
|
645
|
+
type: "boolean"
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
},
|
|
641
649
|
fileChange: function fileChange(e) {
|
|
642
650
|
return _asyncToGenerator(function() {
|
|
643
651
|
var appContext, appDirectory, filename, eventType, isPageFile, absoluteFilePath, isRouteComponent, resolvedConfig, generateCode, entrypoints;
|
|
@@ -296,13 +296,17 @@ var routesForServer = function(param) {
|
|
|
296
296
|
}
|
|
297
297
|
return "\n ".concat(importLoadersCode, "\n ").concat(routesCode, "\n ");
|
|
298
298
|
};
|
|
299
|
+
var createMatchReg = function(keyword) {
|
|
300
|
+
return new RegExp('("'.concat(keyword, '":\\s)"([^,]+)"'), "g");
|
|
301
|
+
};
|
|
299
302
|
var fileSystemRoutes = function() {
|
|
300
303
|
var _ref = _asyncToGenerator(function(param) {
|
|
301
|
-
var routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, loadings, errors, loaders, loadersMap, loadersMapFile, importLazyCode, rootLayoutCode, getDataLoaderPath, traverseRouteTree, routeComponentsCode, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, route, newRoute, component, finalRoute, importLoadingCode, importErrorComponentsCode, importLoadersCode, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _step_value, key, loaderInfo;
|
|
304
|
+
var routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, _param_splitRouteChunks, splitRouteChunks, components, loadings, errors, loaders, loadersMap, loadersMapFile, importLazyCode, rootLayoutCode, getDataLoaderPath, traverseRouteTree, routeComponentsCode, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, route, newRoute, routeStr, keywords, regs, newRouteStr, component, finalRoute, keywords1, routeStr1, regs1, newRouteStr1, importLoadingCode, importComponentsCode, importErrorComponentsCode, importLoadersCode, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _step_value, key, loaderInfo;
|
|
302
305
|
return __generator(this, function(_state) {
|
|
303
306
|
switch(_state.label){
|
|
304
307
|
case 0:
|
|
305
|
-
routes = param.routes, ssrMode = param.ssrMode, nestedRoutesEntry = param.nestedRoutesEntry, entryName = param.entryName, internalDirectory = param.internalDirectory;
|
|
308
|
+
routes = param.routes, ssrMode = param.ssrMode, nestedRoutesEntry = param.nestedRoutesEntry, entryName = param.entryName, internalDirectory = param.internalDirectory, _param_splitRouteChunks = param.splitRouteChunks, splitRouteChunks = _param_splitRouteChunks === void 0 ? true : _param_splitRouteChunks;
|
|
309
|
+
components = [];
|
|
306
310
|
loadings = [];
|
|
307
311
|
errors = [];
|
|
308
312
|
loaders = [];
|
|
@@ -351,20 +355,30 @@ var fileSystemRoutes = function() {
|
|
|
351
355
|
};
|
|
352
356
|
}
|
|
353
357
|
if (route._component) {
|
|
354
|
-
if (
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
if (splitRouteChunks) {
|
|
359
|
+
if (route.isRoot) {
|
|
360
|
+
rootLayoutCode = "import RootLayout from '".concat(route._component, "'");
|
|
361
|
+
component = "RootLayout";
|
|
362
|
+
} else if (ssrMode === "string") {
|
|
363
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(route._component, "')");
|
|
364
|
+
component = "loadable(".concat(lazyImport, ")");
|
|
365
|
+
} else {
|
|
366
|
+
lazyImport = '() => import(/* webpackChunkName: "'.concat(route.id, "\" */ '").concat(route._component, "')");
|
|
367
|
+
component = "lazy(".concat(lazyImport, ")");
|
|
368
|
+
}
|
|
360
369
|
} else {
|
|
361
|
-
|
|
362
|
-
component = "
|
|
370
|
+
components.push(route._component);
|
|
371
|
+
component = "component_".concat(components.length - 1);
|
|
363
372
|
}
|
|
364
373
|
}
|
|
365
374
|
} else if (route._component) {
|
|
366
|
-
|
|
367
|
-
|
|
375
|
+
if (splitRouteChunks) {
|
|
376
|
+
lazyImport = "() => import('".concat(route._component, "')");
|
|
377
|
+
component = "loadable(".concat(lazyImport, ")");
|
|
378
|
+
} else {
|
|
379
|
+
components.push(route._component);
|
|
380
|
+
component = "component_".concat(components.length - 1);
|
|
381
|
+
}
|
|
368
382
|
}
|
|
369
383
|
var finalRoute = _objectSpreadProps(_objectSpread({}, route), {
|
|
370
384
|
lazyImport: lazyImport,
|
|
@@ -385,13 +399,34 @@ var fileSystemRoutes = function() {
|
|
|
385
399
|
route = _step.value;
|
|
386
400
|
if ("type" in route) {
|
|
387
401
|
newRoute = traverseRouteTree(route);
|
|
388
|
-
|
|
402
|
+
routeStr = JSON.stringify(newRoute, null, 2);
|
|
403
|
+
keywords = [
|
|
404
|
+
"component",
|
|
405
|
+
"lazyImport",
|
|
406
|
+
"loader",
|
|
407
|
+
"loading",
|
|
408
|
+
"error"
|
|
409
|
+
];
|
|
410
|
+
regs = keywords.map(createMatchReg);
|
|
411
|
+
newRouteStr = regs.reduce(function(acc, reg) {
|
|
412
|
+
return acc.replace(reg, "$1$2");
|
|
413
|
+
}, routeStr).replace(/"(RootLayout)"/g, "$1").replace(/\\"/g, '"');
|
|
414
|
+
routeComponentsCode += "".concat(newRouteStr, ",");
|
|
389
415
|
} else {
|
|
390
416
|
component = "loadable(() => import('".concat(route._component, "'))");
|
|
391
417
|
finalRoute = _objectSpreadProps(_objectSpread({}, route), {
|
|
392
418
|
component: component
|
|
393
419
|
});
|
|
394
|
-
|
|
420
|
+
keywords1 = [
|
|
421
|
+
"component",
|
|
422
|
+
"lazyImport"
|
|
423
|
+
];
|
|
424
|
+
routeStr1 = JSON.stringify(finalRoute, null, 2);
|
|
425
|
+
regs1 = keywords1.map(createMatchReg);
|
|
426
|
+
newRouteStr1 = regs1.reduce(function(acc, reg) {
|
|
427
|
+
return acc.replace(reg, "$1$2");
|
|
428
|
+
}, routeStr1).replace(/\\"/g, '"');
|
|
429
|
+
routeComponentsCode += "".concat(newRouteStr1, ",");
|
|
395
430
|
}
|
|
396
431
|
}
|
|
397
432
|
} catch (err) {
|
|
@@ -412,6 +447,9 @@ var fileSystemRoutes = function() {
|
|
|
412
447
|
importLoadingCode = loadings.map(function(loading, index2) {
|
|
413
448
|
return "import loading_".concat(index2, " from '").concat(loading, "';\n");
|
|
414
449
|
}).join("");
|
|
450
|
+
importComponentsCode = components.map(function(component, index2) {
|
|
451
|
+
return "import component_".concat(index2, " from '").concat(component, "';\n");
|
|
452
|
+
}).join("");
|
|
415
453
|
importErrorComponentsCode = errors.map(function(error, index2) {
|
|
416
454
|
return "import error_".concat(index2, " from '").concat(error, "';\n");
|
|
417
455
|
}).join("");
|
|
@@ -454,7 +492,7 @@ var fileSystemRoutes = function() {
|
|
|
454
492
|
_state.sent();
|
|
455
493
|
return [
|
|
456
494
|
2,
|
|
457
|
-
"\n ".concat(importLazyCode, "\n ").concat(rootLayoutCode, "\n ").concat(importLoadingCode, "\n ").concat(importErrorComponentsCode, "\n ").concat(importLoadersCode, "\n ").concat(routeComponentsCode, "\n ")
|
|
495
|
+
"\n ".concat(importLazyCode, "\n ").concat(importComponentsCode, "\n ").concat(rootLayoutCode, "\n ").concat(importLoadingCode, "\n ").concat(importErrorComponentsCode, "\n ").concat(importLoadersCode, "\n ").concat(routeComponentsCode, "\n ")
|
|
458
496
|
];
|
|
459
497
|
}
|
|
460
498
|
});
|