@modern-js/app-tools 3.0.0-beta.0 → 3.0.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/LICENSE +1 -1
- package/README.md +2 -2
- package/bin/modern.js +35 -14
- package/dist/cjs/builder/builder-rspack/index.js +40 -0
- package/dist/cjs/builder/generator/adapterCopy.js +79 -0
- package/dist/cjs/builder/generator/createBuilderProviderConfig.js +93 -0
- package/dist/cjs/builder/generator/createCopyPattern.js +67 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +90 -0
- package/dist/cjs/builder/generator/index.js +79 -0
- package/dist/cjs/builder/index.js +50 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +133 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +89 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +151 -0
- package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +51 -0
- package/dist/cjs/builder/shared/builderPlugins/index.js +79 -0
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +71 -0
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +56 -0
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +191 -0
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +72 -0
- package/dist/cjs/builder/shared/createCopyInfo.js +59 -0
- package/dist/cjs/builder/shared/index.js +72 -0
- package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +39 -0
- package/dist/cjs/builder/shared/types.js +18 -0
- package/dist/cjs/commands/build.js +112 -0
- package/dist/cjs/commands/deploy.js +44 -0
- package/dist/cjs/commands/dev.js +126 -0
- package/dist/cjs/commands/index.js +92 -0
- package/dist/cjs/commands/info.js +110 -0
- package/dist/cjs/commands/inspect.js +49 -0
- package/dist/cjs/commands/serve.js +92 -0
- package/dist/cjs/compat/hooks.js +104 -0
- package/dist/cjs/compat/index.js +62 -0
- package/dist/cjs/compat/utils.js +135 -0
- package/dist/cjs/config/default.js +124 -0
- package/dist/cjs/config/index.js +65 -0
- package/dist/cjs/config/initialize/index.js +41 -0
- package/dist/cjs/config/initialize/inits.js +101 -0
- package/dist/cjs/constants.js +40 -0
- package/dist/cjs/defineConfig.js +36 -0
- package/dist/cjs/esm/register-esm.js +69 -0
- package/dist/cjs/esm/register-esm.mjs +31 -0
- package/dist/cjs/esm/ts-node-loader.js +62 -0
- package/dist/cjs/esm/ts-node-loader.mjs +22 -0
- package/dist/cjs/esm/utils.js +69 -0
- package/dist/cjs/esm/utils.mjs +31 -0
- package/dist/cjs/exports/server.js +18 -0
- package/dist/cjs/index.js +294 -0
- package/dist/cjs/locale/en.js +79 -0
- package/dist/cjs/locale/index.js +46 -0
- package/dist/cjs/locale/zh.js +79 -0
- package/dist/cjs/plugins/analyze/constants.js +48 -0
- package/dist/cjs/plugins/analyze/getBundleEntry.js +97 -0
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +117 -0
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +132 -0
- package/dist/cjs/plugins/analyze/getServerRoutes.js +177 -0
- package/dist/cjs/plugins/analyze/index.js +227 -0
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +86 -0
- package/dist/cjs/plugins/analyze/templates.js +56 -0
- package/dist/cjs/plugins/analyze/utils.js +118 -0
- package/dist/cjs/plugins/deploy/index.js +72 -0
- package/dist/cjs/plugins/deploy/platforms/gh-pages.js +87 -0
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.js +36 -0
- package/dist/cjs/plugins/deploy/platforms/netlify-handler.js +89 -0
- package/dist/cjs/plugins/deploy/platforms/netlify.js +156 -0
- package/dist/cjs/plugins/deploy/platforms/node-entry.js +75 -0
- package/dist/cjs/plugins/deploy/platforms/node.js +121 -0
- package/dist/cjs/plugins/deploy/platforms/platform.js +18 -0
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.js +37 -0
- package/dist/cjs/plugins/deploy/platforms/vercel-handler.js +89 -0
- package/dist/cjs/plugins/deploy/platforms/vercel.js +176 -0
- package/dist/cjs/plugins/deploy/utils.js +92 -0
- package/dist/cjs/plugins/initialize/index.js +93 -0
- package/dist/cjs/plugins/serverBuild.js +91 -0
- package/dist/cjs/plugins/serverRuntime.js +49 -0
- package/dist/cjs/run/index.js +98 -0
- package/dist/cjs/types/config/deploy.js +18 -0
- package/dist/cjs/types/config/dev.js +18 -0
- package/dist/cjs/types/config/experiments.js +18 -0
- package/dist/cjs/types/config/html.js +18 -0
- package/dist/cjs/types/config/index.js +58 -0
- package/dist/cjs/types/config/output.js +18 -0
- package/dist/cjs/types/config/performance.js +18 -0
- package/dist/cjs/types/config/resolve.js +18 -0
- package/dist/cjs/types/config/security.js +18 -0
- package/dist/cjs/types/config/source.js +18 -0
- package/dist/cjs/types/config/testing.js +18 -0
- package/dist/cjs/types/config/tools.js +18 -0
- package/dist/cjs/types/index.js +58 -0
- package/dist/cjs/types/plugin.js +18 -0
- package/dist/cjs/types/utils.js +18 -0
- package/dist/cjs/utils/config.js +45 -0
- package/dist/cjs/utils/createServer.js +52 -0
- package/dist/cjs/utils/env.js +46 -0
- package/dist/cjs/utils/generateWatchFiles.js +54 -0
- package/dist/cjs/utils/getConfigFile.js +49 -0
- package/dist/cjs/utils/getSelectedEntries.js +60 -0
- package/dist/cjs/utils/initAppContext.js +71 -0
- package/dist/cjs/utils/loadPlugins.js +85 -0
- package/dist/cjs/utils/printInstructions.js +43 -0
- package/dist/cjs/utils/register.js +105 -0
- package/dist/cjs/utils/restart.js +52 -0
- package/dist/cjs/utils/routes.js +65 -0
- package/dist/cjs/utils/types.js +18 -0
- package/dist/esm/builder/builder-rspack/index.mjs +6 -0
- package/dist/esm/builder/generator/adapterCopy.mjs +35 -0
- package/dist/esm/builder/generator/createBuilderProviderConfig.mjs +59 -0
- package/dist/esm/builder/generator/createCopyPattern.mjs +30 -0
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +56 -0
- package/dist/esm/builder/generator/index.mjs +45 -0
- package/dist/esm/builder/index.mjs +7 -0
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.mjs +89 -0
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +55 -0
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +117 -0
- package/dist/esm/builder/shared/builderPlugins/builderHooks.mjs +17 -0
- package/dist/esm/builder/shared/builderPlugins/index.mjs +4 -0
- package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.mjs +37 -0
- package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.mjs +22 -0
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.mjs +157 -0
- package/dist/esm/builder/shared/bundlerPlugins/index.mjs +3 -0
- package/dist/esm/builder/shared/createCopyInfo.mjs +15 -0
- package/dist/esm/builder/shared/index.mjs +3 -0
- package/dist/esm/builder/shared/loaders/serverModuleLoader.mjs +5 -0
- package/dist/esm/commands/build.mjs +68 -0
- package/dist/esm/commands/deploy.mjs +10 -0
- package/dist/esm/commands/dev.mjs +82 -0
- package/dist/esm/commands/index.mjs +43 -0
- package/dist/esm/commands/info.mjs +76 -0
- package/dist/esm/commands/inspect.mjs +15 -0
- package/dist/esm/commands/serve.mjs +48 -0
- package/dist/esm/compat/hooks.mjs +67 -0
- package/dist/esm/compat/index.mjs +28 -0
- package/dist/esm/compat/utils.mjs +95 -0
- package/dist/esm/config/default.mjs +90 -0
- package/dist/esm/config/index.mjs +2 -0
- package/dist/esm/config/initialize/index.mjs +7 -0
- package/dist/esm/config/initialize/inits.mjs +54 -0
- package/dist/esm/constants.mjs +3 -0
- package/dist/esm/defineConfig.mjs +2 -0
- package/dist/esm/esm/register-esm.mjs +32 -0
- package/dist/esm/esm/ts-node-loader.mjs +22 -0
- package/dist/esm/esm/utils.mjs +32 -0
- package/dist/esm/index.mjs +122 -0
- package/dist/esm/locale/en.mjs +45 -0
- package/dist/esm/locale/index.mjs +9 -0
- package/dist/esm/locale/zh.mjs +45 -0
- package/dist/esm/plugins/analyze/constants.mjs +8 -0
- package/dist/esm/plugins/analyze/getBundleEntry.mjs +53 -0
- package/dist/esm/plugins/analyze/getFileSystemEntry.mjs +66 -0
- package/dist/esm/plugins/analyze/getHtmlTemplate.mjs +85 -0
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +130 -0
- package/dist/esm/plugins/analyze/index.mjs +193 -0
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +41 -0
- package/dist/esm/plugins/analyze/templates.mjs +22 -0
- package/dist/esm/plugins/analyze/utils.mjs +55 -0
- package/dist/esm/plugins/deploy/index.mjs +38 -0
- package/dist/esm/plugins/deploy/platforms/gh-pages.mjs +43 -0
- package/dist/esm/plugins/deploy/platforms/netlify-entry.mjs +2 -0
- package/dist/esm/plugins/deploy/platforms/netlify-handler.mjs +85 -0
- package/dist/esm/plugins/deploy/platforms/netlify.mjs +112 -0
- package/dist/esm/plugins/deploy/platforms/node-entry.mjs +68 -0
- package/dist/esm/plugins/deploy/platforms/node.mjs +77 -0
- package/dist/esm/plugins/deploy/platforms/vercel-entry.mjs +3 -0
- package/dist/esm/plugins/deploy/platforms/vercel-handler.mjs +85 -0
- package/dist/esm/plugins/deploy/platforms/vercel.mjs +132 -0
- package/dist/esm/plugins/deploy/utils.mjs +39 -0
- package/dist/esm/plugins/initialize/index.mjs +59 -0
- package/dist/esm/plugins/serverBuild.mjs +46 -0
- package/dist/esm/plugins/serverRuntime.mjs +15 -0
- package/dist/esm/run/index.mjs +61 -0
- package/dist/esm/types/config/index.mjs +1 -0
- package/dist/esm/types/index.mjs +1 -0
- package/dist/esm/utils/config.mjs +11 -0
- package/dist/esm/utils/createServer.mjs +12 -0
- package/dist/esm/utils/env.mjs +12 -0
- package/dist/esm/utils/generateWatchFiles.mjs +10 -0
- package/dist/esm/utils/getConfigFile.mjs +5 -0
- package/dist/esm/utils/getSelectedEntries.mjs +26 -0
- package/dist/esm/utils/initAppContext.mjs +27 -0
- package/dist/esm/utils/loadPlugins.mjs +45 -0
- package/dist/esm/utils/printInstructions.mjs +9 -0
- package/dist/esm/utils/register.mjs +61 -0
- package/dist/esm/utils/restart.mjs +18 -0
- package/dist/esm/utils/routes.mjs +15 -0
- package/dist/esm-node/builder/builder-rspack/index.mjs +7 -0
- package/dist/esm-node/builder/generator/adapterCopy.mjs +36 -0
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.mjs +60 -0
- package/dist/esm-node/builder/generator/createCopyPattern.mjs +31 -0
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +57 -0
- package/dist/esm-node/builder/generator/index.mjs +46 -0
- package/dist/esm-node/builder/index.mjs +8 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.mjs +93 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +56 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +119 -0
- package/dist/esm-node/builder/shared/builderPlugins/builderHooks.mjs +18 -0
- package/dist/esm-node/builder/shared/builderPlugins/index.mjs +5 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.mjs +38 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.mjs +23 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.mjs +158 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +4 -0
- package/dist/esm-node/builder/shared/createCopyInfo.mjs +16 -0
- package/dist/esm-node/builder/shared/index.mjs +4 -0
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.mjs +6 -0
- package/dist/esm-node/builder/shared/types.mjs +1 -0
- package/dist/esm-node/commands/build.mjs +69 -0
- package/dist/esm-node/commands/deploy.mjs +11 -0
- package/dist/esm-node/commands/dev.mjs +83 -0
- package/dist/esm-node/commands/index.mjs +44 -0
- package/dist/esm-node/commands/info.mjs +77 -0
- package/dist/esm-node/commands/inspect.mjs +16 -0
- package/dist/esm-node/commands/serve.mjs +49 -0
- package/dist/esm-node/compat/hooks.mjs +68 -0
- package/dist/esm-node/compat/index.mjs +29 -0
- package/dist/esm-node/compat/utils.mjs +96 -0
- package/dist/esm-node/config/default.mjs +91 -0
- package/dist/esm-node/config/index.mjs +3 -0
- package/dist/esm-node/config/initialize/index.mjs +8 -0
- package/dist/esm-node/config/initialize/inits.mjs +55 -0
- package/dist/esm-node/constants.mjs +4 -0
- package/dist/esm-node/defineConfig.mjs +3 -0
- package/dist/esm-node/esm/register-esm.mjs +33 -0
- package/dist/esm-node/esm/ts-node-loader.mjs +23 -0
- package/dist/esm-node/esm/utils.mjs +33 -0
- package/dist/esm-node/exports/server.mjs +1 -0
- package/dist/esm-node/index.mjs +124 -0
- package/dist/esm-node/locale/en.mjs +46 -0
- package/dist/esm-node/locale/index.mjs +10 -0
- package/dist/esm-node/locale/zh.mjs +46 -0
- package/dist/esm-node/plugins/analyze/constants.mjs +9 -0
- package/dist/esm-node/plugins/analyze/getBundleEntry.mjs +54 -0
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.mjs +67 -0
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +86 -0
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +131 -0
- package/dist/esm-node/plugins/analyze/index.mjs +194 -0
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +42 -0
- package/dist/esm-node/plugins/analyze/templates.mjs +23 -0
- package/dist/esm-node/plugins/analyze/utils.mjs +56 -0
- package/dist/esm-node/plugins/deploy/index.mjs +39 -0
- package/dist/esm-node/plugins/deploy/platforms/gh-pages.mjs +44 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify-entry.mjs +3 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify-handler.mjs +89 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify.mjs +117 -0
- package/dist/esm-node/plugins/deploy/platforms/node-entry.mjs +72 -0
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +82 -0
- package/dist/esm-node/plugins/deploy/platforms/platform.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel-entry.mjs +4 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel-handler.mjs +89 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel.mjs +137 -0
- package/dist/esm-node/plugins/deploy/utils.mjs +40 -0
- package/dist/esm-node/plugins/initialize/index.mjs +60 -0
- package/dist/esm-node/plugins/serverBuild.mjs +47 -0
- package/dist/esm-node/plugins/serverRuntime.mjs +16 -0
- package/dist/esm-node/run/index.mjs +62 -0
- package/dist/esm-node/types/config/deploy.mjs +1 -0
- package/dist/esm-node/types/config/dev.mjs +1 -0
- package/dist/esm-node/types/config/experiments.mjs +1 -0
- package/dist/esm-node/types/config/html.mjs +1 -0
- package/dist/esm-node/types/config/index.mjs +2 -0
- package/dist/esm-node/types/config/output.mjs +1 -0
- package/dist/esm-node/types/config/performance.mjs +1 -0
- package/dist/esm-node/types/config/resolve.mjs +1 -0
- package/dist/esm-node/types/config/security.mjs +1 -0
- package/dist/esm-node/types/config/source.mjs +1 -0
- package/dist/esm-node/types/config/testing.mjs +1 -0
- package/dist/esm-node/types/config/tools.mjs +1 -0
- package/dist/esm-node/types/index.mjs +2 -0
- package/dist/esm-node/types/plugin.mjs +1 -0
- package/dist/esm-node/types/utils.mjs +1 -0
- package/dist/esm-node/utils/config.mjs +12 -0
- package/dist/esm-node/utils/createServer.mjs +13 -0
- package/dist/esm-node/utils/env.mjs +13 -0
- package/dist/esm-node/utils/generateWatchFiles.mjs +11 -0
- package/dist/esm-node/utils/getConfigFile.mjs +6 -0
- package/dist/esm-node/utils/getSelectedEntries.mjs +27 -0
- package/dist/esm-node/utils/initAppContext.mjs +28 -0
- package/dist/esm-node/utils/loadPlugins.mjs +46 -0
- package/dist/esm-node/utils/printInstructions.mjs +10 -0
- package/dist/esm-node/utils/register.mjs +63 -0
- package/dist/esm-node/utils/restart.mjs +19 -0
- package/dist/esm-node/utils/routes.mjs +16 -0
- package/dist/esm-node/utils/types.mjs +1 -0
- package/dist/types/builder/builder-rspack/index.d.ts +2 -2
- package/dist/types/builder/generator/adapterCopy.d.ts +3 -0
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -2
- package/dist/types/builder/generator/createCopyPattern.d.ts +16 -0
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +6 -0
- package/dist/types/builder/generator/index.d.ts +4 -13
- package/dist/types/builder/index.d.ts +3 -1
- package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +3 -0
- package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +3 -0
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +3 -0
- package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +3 -0
- package/dist/types/builder/shared/builderPlugins/index.d.ts +4 -0
- package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +6 -8
- package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +8 -10
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +32 -0
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +3 -0
- package/dist/types/builder/shared/createCopyInfo.d.ts +8 -0
- package/dist/types/builder/shared/index.d.ts +2 -2
- package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +3 -4
- package/dist/types/builder/shared/types.d.ts +6 -16
- package/dist/types/commands/build.d.ts +3 -3
- package/dist/types/commands/deploy.d.ts +2 -2
- package/dist/types/commands/dev.d.ts +8 -3
- package/dist/types/commands/index.d.ts +9 -3
- package/dist/types/commands/info.d.ts +18 -0
- package/dist/types/commands/inspect.d.ts +3 -10
- package/dist/types/commands/serve.d.ts +7 -2
- package/dist/types/compat/hooks.d.ts +7 -0
- package/dist/types/compat/index.d.ts +2 -0
- package/dist/types/compat/utils.d.ts +13 -0
- package/dist/types/config/default.d.ts +3 -3
- package/dist/types/config/index.d.ts +1 -2
- package/dist/types/config/initialize/index.d.ts +3 -2
- package/dist/types/config/initialize/inits.d.ts +4 -4
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/defineConfig.d.ts +9 -7
- package/dist/types/esm/register-esm.d.mts +5 -0
- package/dist/types/esm/ts-node-loader.d.mts +7 -0
- package/dist/types/esm/utils.d.mts +5 -0
- package/dist/types/exports/server.d.ts +1 -1
- package/dist/types/index.d.ts +11 -14
- package/dist/types/locale/en.d.ts +42 -35
- package/dist/types/locale/index.d.ts +84 -70
- package/dist/types/locale/zh.d.ts +42 -35
- package/dist/types/plugins/analyze/constants.d.ts +3 -0
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +4 -0
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +7 -0
- package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +27 -0
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +8 -0
- package/dist/types/plugins/analyze/index.d.ts +3 -0
- package/dist/types/{analyze → plugins/analyze}/isDefaultExportFunction.d.ts +1 -1
- package/dist/types/plugins/analyze/templates.d.ts +5 -0
- package/dist/types/plugins/analyze/utils.d.ts +10 -0
- package/dist/types/plugins/deploy/index.d.ts +3 -0
- package/dist/types/plugins/deploy/platforms/gh-pages.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.cts +2 -0
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/netlify-handler.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/netlify.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/node-entry.d.ts +1 -0
- package/dist/types/plugins/deploy/platforms/node.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/platform.d.ts +10 -0
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.mts +2 -0
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/vercel-handler.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/vercel.d.ts +2 -0
- package/dist/types/plugins/deploy/utils.d.ts +23 -0
- package/dist/types/plugins/initialize/index.d.ts +3 -0
- package/dist/types/plugins/serverBuild.d.ts +3 -0
- package/dist/types/plugins/serverRuntime.d.ts +3 -0
- package/dist/types/run/index.d.ts +20 -0
- package/dist/types/types/config/deploy.d.ts +21 -5
- package/dist/types/types/config/dev.d.ts +54 -10
- package/dist/types/types/config/experiments.d.ts +2 -2
- package/dist/types/types/config/html.d.ts +2 -5
- package/dist/types/types/config/index.d.ts +42 -53
- package/dist/types/types/config/output.d.ts +35 -26
- package/dist/types/types/config/performance.d.ts +3 -7
- package/dist/types/types/config/resolve.d.ts +2 -0
- package/dist/types/types/config/security.d.ts +2 -4
- package/dist/types/types/config/source.d.ts +43 -24
- package/dist/types/types/config/testing.d.ts +8 -0
- package/dist/types/types/config/tools.d.ts +19 -28
- package/dist/types/types/index.d.ts +9 -34
- package/dist/types/types/plugin.d.ts +114 -0
- package/dist/types/types/utils.d.ts +0 -6
- package/dist/types/utils/config.d.ts +1 -21
- package/dist/types/utils/createServer.d.ts +4 -11
- package/dist/types/utils/env.d.ts +2 -2
- package/dist/types/utils/generateWatchFiles.d.ts +2 -3
- package/dist/types/utils/getConfigFile.d.ts +1 -0
- package/dist/types/utils/getSelectedEntries.d.ts +2 -3
- package/dist/types/utils/initAppContext.d.ts +30 -0
- package/dist/types/utils/loadPlugins.d.ts +15 -0
- package/dist/types/utils/printInstructions.d.ts +3 -3
- package/dist/types/utils/register.d.ts +7 -0
- package/dist/types/utils/restart.d.ts +2 -3
- package/dist/types/utils/routes.d.ts +4 -3
- package/dist/types/utils/types.d.ts +18 -12
- package/lib/types.d.ts +92 -61
- package/package.json +81 -60
- package/rslib.config.mts +20 -0
- package/rstest.config.ts +24 -0
- package/CHANGELOG.md +0 -3420
- package/dist/js/modern/analyze/constants.js +0 -56
- package/dist/js/modern/analyze/generateCode.js +0 -247
- package/dist/js/modern/analyze/getBundleEntry.js +0 -71
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +0 -220
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +0 -216
- package/dist/js/modern/analyze/getClientRoutes/index.js +0 -6
- package/dist/js/modern/analyze/getClientRoutes/utils.js +0 -31
- package/dist/js/modern/analyze/getFileSystemEntry.js +0 -109
- package/dist/js/modern/analyze/getHtmlTemplate.js +0 -115
- package/dist/js/modern/analyze/getServerRoutes.js +0 -178
- package/dist/js/modern/analyze/index.js +0 -333
- package/dist/js/modern/analyze/isDefaultExportFunction.js +0 -42
- package/dist/js/modern/analyze/makeLegalIdentifier.js +0 -13
- package/dist/js/modern/analyze/nestedRoutes.js +0 -186
- package/dist/js/modern/analyze/templates.js +0 -327
- package/dist/js/modern/analyze/utils.js +0 -141
- package/dist/js/modern/builder/builder-rspack/index.js +0 -8
- package/dist/js/modern/builder/builder-webpack/builderPlugins/compatModern.js +0 -41
- package/dist/js/modern/builder/builder-webpack/index.js +0 -93
- package/dist/js/modern/builder/builder-webpack/webpackPlugins/RouterPlugin.js +0 -116
- package/dist/js/modern/builder/builder-webpack/webpackPlugins/index.js +0 -1
- package/dist/js/modern/builder/generator/createBuilderOptions.js +0 -24
- package/dist/js/modern/builder/generator/createBuilderProviderConfig.js +0 -39
- package/dist/js/modern/builder/generator/getBuilderTargets.js +0 -21
- package/dist/js/modern/builder/generator/index.js +0 -53
- package/dist/js/modern/builder/index.js +0 -39
- package/dist/js/modern/builder/shared/builderPlugins/adapterModern.js +0 -219
- package/dist/js/modern/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -27
- package/dist/js/modern/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -34
- package/dist/js/modern/builder/shared/createCopyPattern.js +0 -46
- package/dist/js/modern/builder/shared/index.js +0 -3
- package/dist/js/modern/builder/shared/loaders/serverModuleLoader.js +0 -7
- package/dist/js/modern/commands/build.js +0 -91
- package/dist/js/modern/commands/deploy.js +0 -28
- package/dist/js/modern/commands/dev.js +0 -109
- package/dist/js/modern/commands/index.js +0 -3
- package/dist/js/modern/commands/inspect.js +0 -38
- package/dist/js/modern/commands/serve.js +0 -54
- package/dist/js/modern/config/default.js +0 -175
- package/dist/js/modern/config/index.js +0 -3
- package/dist/js/modern/config/initialize/index.js +0 -12
- package/dist/js/modern/config/initialize/inits.js +0 -154
- package/dist/js/modern/config/legacy/createHtmlConfig.js +0 -35
- package/dist/js/modern/config/legacy/createOutputConfig.js +0 -68
- package/dist/js/modern/config/legacy/createSourceConfig.js +0 -39
- package/dist/js/modern/config/legacy/createToolsConfig.js +0 -42
- package/dist/js/modern/config/legacy/index.js +0 -51
- package/dist/js/modern/defineConfig.js +0 -27
- package/dist/js/modern/exports/server.js +0 -4
- package/dist/js/modern/hooks.js +0 -35
- package/dist/js/modern/index.js +0 -221
- package/dist/js/modern/initialize/index.js +0 -132
- package/dist/js/modern/locale/en.js +0 -36
- package/dist/js/modern/locale/index.js +0 -9
- package/dist/js/modern/locale/zh.js +0 -36
- package/dist/js/modern/schema/Schema.js +0 -40
- package/dist/js/modern/schema/index.js +0 -88
- package/dist/js/modern/schema/legacy.js +0 -148
- package/dist/js/modern/types/config/index.js +0 -1
- package/dist/js/modern/types/index.js +0 -3
- package/dist/js/modern/types/utils.js +0 -0
- package/dist/js/modern/utils/config.js +0 -128
- package/dist/js/modern/utils/createServer.js +0 -75
- package/dist/js/modern/utils/env.js +0 -15
- package/dist/js/modern/utils/generateWatchFiles.js +0 -55
- package/dist/js/modern/utils/getSelectedEntries.js +0 -58
- package/dist/js/modern/utils/getServerInternalPlugins.js +0 -58
- package/dist/js/modern/utils/language.js +0 -8
- package/dist/js/modern/utils/printInstructions.js +0 -31
- package/dist/js/modern/utils/restart.js +0 -44
- package/dist/js/modern/utils/routes.js +0 -30
- package/dist/js/modern/utils/types.js +0 -0
- package/dist/js/node/analyze/constants.js +0 -100
- package/dist/js/node/analyze/generateCode.js +0 -271
- package/dist/js/node/analyze/getBundleEntry.js +0 -95
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +0 -242
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +0 -238
- package/dist/js/node/analyze/getClientRoutes/index.js +0 -30
- package/dist/js/node/analyze/getClientRoutes/utils.js +0 -58
- package/dist/js/node/analyze/getFileSystemEntry.js +0 -131
- package/dist/js/node/analyze/getHtmlTemplate.js +0 -144
- package/dist/js/node/analyze/getServerRoutes.js +0 -196
- package/dist/js/node/analyze/index.js +0 -340
- package/dist/js/node/analyze/isDefaultExportFunction.js +0 -71
- package/dist/js/node/analyze/makeLegalIdentifier.js +0 -36
- package/dist/js/node/analyze/nestedRoutes.js +0 -213
- package/dist/js/node/analyze/templates.js +0 -358
- package/dist/js/node/analyze/utils.js +0 -172
- package/dist/js/node/builder/builder-rspack/index.js +0 -31
- package/dist/js/node/builder/builder-webpack/builderPlugins/compatModern.js +0 -64
- package/dist/js/node/builder/builder-webpack/index.js +0 -118
- package/dist/js/node/builder/builder-webpack/webpackPlugins/RouterPlugin.js +0 -140
- package/dist/js/node/builder/builder-webpack/webpackPlugins/index.js +0 -17
- package/dist/js/node/builder/generator/createBuilderOptions.js +0 -47
- package/dist/js/node/builder/generator/createBuilderProviderConfig.js +0 -60
- package/dist/js/node/builder/generator/getBuilderTargets.js +0 -39
- package/dist/js/node/builder/generator/index.js +0 -82
- package/dist/js/node/builder/index.js +0 -68
- package/dist/js/node/builder/shared/builderPlugins/adapterModern.js +0 -245
- package/dist/js/node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -50
- package/dist/js/node/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -57
- package/dist/js/node/builder/shared/createCopyPattern.js +0 -75
- package/dist/js/node/builder/shared/index.js +0 -19
- package/dist/js/node/builder/shared/loaders/serverModuleLoader.js +0 -28
- package/dist/js/node/builder/shared/types.js +0 -15
- package/dist/js/node/commands/build.js +0 -112
- package/dist/js/node/commands/deploy.js +0 -51
- package/dist/js/node/commands/dev.js +0 -126
- package/dist/js/node/commands/index.js +0 -19
- package/dist/js/node/commands/inspect.js +0 -61
- package/dist/js/node/commands/serve.js +0 -83
- package/dist/js/node/config/default.js +0 -197
- package/dist/js/node/config/index.js +0 -19
- package/dist/js/node/config/initialize/index.js +0 -35
- package/dist/js/node/config/initialize/inits.js +0 -177
- package/dist/js/node/config/legacy/createHtmlConfig.js +0 -58
- package/dist/js/node/config/legacy/createOutputConfig.js +0 -91
- package/dist/js/node/config/legacy/createSourceConfig.js +0 -62
- package/dist/js/node/config/legacy/createToolsConfig.js +0 -65
- package/dist/js/node/config/legacy/index.js +0 -75
- package/dist/js/node/defineConfig.js +0 -49
- package/dist/js/node/exports/server.js +0 -27
- package/dist/js/node/hooks.js +0 -54
- package/dist/js/node/index.js +0 -245
- package/dist/js/node/initialize/index.js +0 -141
- package/dist/js/node/locale/en.js +0 -59
- package/dist/js/node/locale/index.js +0 -33
- package/dist/js/node/locale/zh.js +0 -59
- package/dist/js/node/schema/Schema.js +0 -63
- package/dist/js/node/schema/index.js +0 -118
- package/dist/js/node/schema/legacy.js +0 -169
- package/dist/js/node/types/config/deploy.js +0 -15
- package/dist/js/node/types/config/dev.js +0 -15
- package/dist/js/node/types/config/experiments.js +0 -15
- package/dist/js/node/types/config/html.js +0 -15
- package/dist/js/node/types/config/index.js +0 -17
- package/dist/js/node/types/config/output.js +0 -15
- package/dist/js/node/types/config/performance.js +0 -15
- package/dist/js/node/types/config/security.js +0 -15
- package/dist/js/node/types/config/source.js +0 -15
- package/dist/js/node/types/config/tools.js +0 -15
- package/dist/js/node/types/hooks.js +0 -15
- package/dist/js/node/types/index.js +0 -19
- package/dist/js/node/types/legacyConfig/deploy.js +0 -15
- package/dist/js/node/types/legacyConfig/dev.js +0 -15
- package/dist/js/node/types/legacyConfig/index.js +0 -15
- package/dist/js/node/types/legacyConfig/output.js +0 -15
- package/dist/js/node/types/legacyConfig/source.js +0 -15
- package/dist/js/node/types/legacyConfig/tools.js +0 -15
- package/dist/js/node/types/utils.js +0 -15
- package/dist/js/node/utils/config.js +0 -153
- package/dist/js/node/utils/createServer.js +0 -106
- package/dist/js/node/utils/env.js +0 -38
- package/dist/js/node/utils/generateWatchFiles.js +0 -85
- package/dist/js/node/utils/getSelectedEntries.js +0 -81
- package/dist/js/node/utils/getServerInternalPlugins.js +0 -79
- package/dist/js/node/utils/language.js +0 -31
- package/dist/js/node/utils/printInstructions.js +0 -54
- package/dist/js/node/utils/restart.js +0 -67
- package/dist/js/node/utils/routes.js +0 -59
- package/dist/js/node/utils/types.js +0 -15
- package/dist/js/treeshaking/analyze/constants.js +0 -42
- package/dist/js/treeshaking/analyze/generateCode.js +0 -485
- package/dist/js/treeshaking/analyze/getBundleEntry.js +0 -62
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +0 -233
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +0 -231
- package/dist/js/treeshaking/analyze/getClientRoutes/index.js +0 -3
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +0 -23
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +0 -107
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +0 -302
- package/dist/js/treeshaking/analyze/getServerRoutes.js +0 -224
- package/dist/js/treeshaking/analyze/index.js +0 -702
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +0 -47
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +0 -13
- package/dist/js/treeshaking/analyze/nestedRoutes.js +0 -409
- package/dist/js/treeshaking/analyze/templates.js +0 -464
- package/dist/js/treeshaking/analyze/utils.js +0 -374
- package/dist/js/treeshaking/builder/builder-rspack/index.js +0 -6
- package/dist/js/treeshaking/builder/builder-webpack/builderPlugins/compatModern.js +0 -64
- package/dist/js/treeshaking/builder/builder-webpack/index.js +0 -301
- package/dist/js/treeshaking/builder/builder-webpack/webpackPlugins/RouterPlugin.js +0 -346
- package/dist/js/treeshaking/builder/builder-webpack/webpackPlugins/index.js +0 -1
- package/dist/js/treeshaking/builder/generator/createBuilderOptions.js +0 -41
- package/dist/js/treeshaking/builder/generator/createBuilderProviderConfig.js +0 -70
- package/dist/js/treeshaking/builder/generator/getBuilderTargets.js +0 -16
- package/dist/js/treeshaking/builder/generator/index.js +0 -199
- package/dist/js/treeshaking/builder/index.js +0 -175
- package/dist/js/treeshaking/builder/shared/builderPlugins/adapterModern.js +0 -300
- package/dist/js/treeshaking/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -110
- package/dist/js/treeshaking/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -72
- package/dist/js/treeshaking/builder/shared/createCopyPattern.js +0 -40
- package/dist/js/treeshaking/builder/shared/index.js +0 -3
- package/dist/js/treeshaking/builder/shared/loaders/serverModuleLoader.js +0 -5
- package/dist/js/treeshaking/builder/shared/types.js +0 -1
- package/dist/js/treeshaking/commands/build.js +0 -291
- package/dist/js/treeshaking/commands/deploy.js +0 -154
- package/dist/js/treeshaking/commands/dev.js +0 -301
- package/dist/js/treeshaking/commands/index.js +0 -3
- package/dist/js/treeshaking/commands/inspect.js +0 -149
- package/dist/js/treeshaking/commands/serve.js +0 -199
- package/dist/js/treeshaking/config/default.js +0 -210
- package/dist/js/treeshaking/config/index.js +0 -3
- package/dist/js/treeshaking/config/initialize/index.js +0 -10
- package/dist/js/treeshaking/config/initialize/inits.js +0 -211
- package/dist/js/treeshaking/config/legacy/createHtmlConfig.js +0 -19
- package/dist/js/treeshaking/config/legacy/createOutputConfig.js +0 -41
- package/dist/js/treeshaking/config/legacy/createSourceConfig.js +0 -42
- package/dist/js/treeshaking/config/legacy/createToolsConfig.js +0 -23
- package/dist/js/treeshaking/config/legacy/index.js +0 -38
- package/dist/js/treeshaking/defineConfig.js +0 -61
- package/dist/js/treeshaking/exports/server.js +0 -2
- package/dist/js/treeshaking/hooks.js +0 -29
- package/dist/js/treeshaking/index.js +0 -713
- package/dist/js/treeshaking/initialize/index.js +0 -284
- package/dist/js/treeshaking/locale/en.js +0 -38
- package/dist/js/treeshaking/locale/index.js +0 -9
- package/dist/js/treeshaking/locale/zh.js +0 -38
- package/dist/js/treeshaking/schema/Schema.js +0 -273
- package/dist/js/treeshaking/schema/index.js +0 -181
- package/dist/js/treeshaking/schema/legacy.js +0 -337
- package/dist/js/treeshaking/types/config/deploy.js +0 -1
- package/dist/js/treeshaking/types/config/dev.js +0 -1
- package/dist/js/treeshaking/types/config/experiments.js +0 -1
- package/dist/js/treeshaking/types/config/html.js +0 -1
- package/dist/js/treeshaking/types/config/index.js +0 -1
- package/dist/js/treeshaking/types/config/output.js +0 -1
- package/dist/js/treeshaking/types/config/performance.js +0 -1
- package/dist/js/treeshaking/types/config/security.js +0 -1
- package/dist/js/treeshaking/types/config/source.js +0 -1
- package/dist/js/treeshaking/types/config/tools.js +0 -1
- package/dist/js/treeshaking/types/hooks.js +0 -1
- package/dist/js/treeshaking/types/index.js +0 -3
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/dev.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/index.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/output.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/source.js +0 -1
- package/dist/js/treeshaking/types/legacyConfig/tools.js +0 -1
- package/dist/js/treeshaking/types/utils.js +0 -1
- package/dist/js/treeshaking/utils/config.js +0 -302
- package/dist/js/treeshaking/utils/createServer.js +0 -258
- package/dist/js/treeshaking/utils/env.js +0 -13
- package/dist/js/treeshaking/utils/generateWatchFiles.js +0 -214
- package/dist/js/treeshaking/utils/getSelectedEntries.js +0 -186
- package/dist/js/treeshaking/utils/getServerInternalPlugins.js +0 -210
- package/dist/js/treeshaking/utils/language.js +0 -6
- package/dist/js/treeshaking/utils/printInstructions.js +0 -152
- package/dist/js/treeshaking/utils/restart.js +0 -187
- package/dist/js/treeshaking/utils/routes.js +0 -153
- package/dist/js/treeshaking/utils/types.js +0 -1
- package/dist/types/analyze/constants.d.ts +0 -32
- package/dist/types/analyze/generateCode.d.ts +0 -5
- package/dist/types/analyze/getBundleEntry.d.ts +0 -3
- package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +0 -14
- package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +0 -15
- package/dist/types/analyze/getClientRoutes/index.d.ts +0 -2
- package/dist/types/analyze/getClientRoutes/utils.d.ts +0 -5
- package/dist/types/analyze/getFileSystemEntry.d.ts +0 -4
- package/dist/types/analyze/getHtmlTemplate.d.ts +0 -9
- package/dist/types/analyze/getServerRoutes.d.ts +0 -10
- package/dist/types/analyze/index.d.ts +0 -10
- package/dist/types/analyze/makeLegalIdentifier.d.ts +0 -1
- package/dist/types/analyze/nestedRoutes.d.ts +0 -5
- package/dist/types/analyze/templates.d.ts +0 -45
- package/dist/types/analyze/utils.d.ts +0 -27
- package/dist/types/builder/builder-webpack/builderPlugins/compatModern.d.ts +0 -14
- package/dist/types/builder/builder-webpack/index.d.ts +0 -4
- package/dist/types/builder/builder-webpack/webpackPlugins/RouterPlugin.d.ts +0 -4
- package/dist/types/builder/builder-webpack/webpackPlugins/index.d.ts +0 -1
- package/dist/types/builder/generator/createBuilderOptions.d.ts +0 -3
- package/dist/types/builder/generator/getBuilderTargets.d.ts +0 -3
- package/dist/types/builder/shared/builderPlugins/adapterModern.d.ts +0 -13
- package/dist/types/builder/shared/createCopyPattern.d.ts +0 -26
- package/dist/types/config/legacy/createHtmlConfig.d.ts +0 -2
- package/dist/types/config/legacy/createOutputConfig.d.ts +0 -2
- package/dist/types/config/legacy/createSourceConfig.d.ts +0 -2
- package/dist/types/config/legacy/createToolsConfig.d.ts +0 -2
- package/dist/types/config/legacy/index.d.ts +0 -3
- package/dist/types/hooks.d.ts +0 -2
- package/dist/types/initialize/index.d.ts +0 -9
- package/dist/types/schema/Schema.d.ts +0 -14
- package/dist/types/schema/index.d.ts +0 -4
- package/dist/types/schema/legacy.d.ts +0 -3
- package/dist/types/types/hooks.d.ts +0 -86
- package/dist/types/types/legacyConfig/deploy.d.ts +0 -8
- package/dist/types/types/legacyConfig/dev.d.ts +0 -13
- package/dist/types/types/legacyConfig/index.d.ts +0 -33
- package/dist/types/types/legacyConfig/output.d.ts +0 -51
- package/dist/types/types/legacyConfig/source.d.ts +0 -25
- package/dist/types/types/legacyConfig/tools.d.ts +0 -17
- package/dist/types/utils/getServerInternalPlugins.d.ts +0 -2
- package/dist/types/utils/language.d.ts +0 -1
- /package/dist/{js/modern/builder/shared/types.js → esm/builder/shared/types.mjs} +0 -0
- /package/dist/{js/modern/types/config/deploy.js → esm/exports/server.mjs} +0 -0
- /package/dist/{js/modern/types/config/dev.js → esm/plugins/deploy/platforms/platform.mjs} +0 -0
- /package/dist/{js/modern/types/config/experiments.js → esm/types/config/deploy.mjs} +0 -0
- /package/dist/{js/modern/types/config/html.js → esm/types/config/dev.mjs} +0 -0
- /package/dist/{js/modern/types/config/output.js → esm/types/config/experiments.mjs} +0 -0
- /package/dist/{js/modern/types/config/performance.js → esm/types/config/html.mjs} +0 -0
- /package/dist/{js/modern/types/config/security.js → esm/types/config/output.mjs} +0 -0
- /package/dist/{js/modern/types/config/source.js → esm/types/config/performance.mjs} +0 -0
- /package/dist/{js/modern/types/config/tools.js → esm/types/config/resolve.mjs} +0 -0
- /package/dist/{js/modern/types/hooks.js → esm/types/config/security.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/deploy.js → esm/types/config/source.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/dev.js → esm/types/config/testing.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/index.js → esm/types/config/tools.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/output.js → esm/types/plugin.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/source.js → esm/types/utils.mjs} +0 -0
- /package/dist/{js/modern/types/legacyConfig/tools.js → esm/utils/types.mjs} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
builderPluginAdapterBasic: ()=>builderPluginAdapterBasic
|
|
37
|
+
});
|
|
38
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
39
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
40
|
+
const builder_namespaceObject = require("@modern-js/builder");
|
|
41
|
+
const builderPluginAdapterBasic = (options)=>({
|
|
42
|
+
name: 'builder-plugin-adapter-modern-basic',
|
|
43
|
+
setup (api) {
|
|
44
|
+
api.modifyBundlerChain((chain, { target, CHAIN_ID, environment })=>{
|
|
45
|
+
const isServiceWorker = environment.name === builder_namespaceObject.SERVICE_WORKER_ENVIRONMENT_NAME;
|
|
46
|
+
if ('node' === target || isServiceWorker) applyNodeCompat(isServiceWorker, chain);
|
|
47
|
+
if ('web' === target) {
|
|
48
|
+
const bareServerModuleReg = /\.(server|node)\.[tj]sx?$/;
|
|
49
|
+
const depExt = 'js';
|
|
50
|
+
chain.module.rule(CHAIN_ID.RULE.JS).exclude.add(bareServerModuleReg);
|
|
51
|
+
chain.module.rule('bare-server-module').test(bareServerModuleReg).use('server-module-loader').loader(external_node_path_default().join(__dirname, `../loaders/serverModuleLoader.${depExt}`));
|
|
52
|
+
}
|
|
53
|
+
const { appContext } = options;
|
|
54
|
+
const { metaName } = appContext;
|
|
55
|
+
chain.watchOptions({
|
|
56
|
+
ignored: [
|
|
57
|
+
`[\\\\/](?:node_modules(?![\\\\/]\\.${metaName})|.git)[\\\\/]`
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
api.modifyRspackConfig((config, { target, environment })=>{
|
|
62
|
+
const isServiceWorker = environment.name === builder_namespaceObject.SERVICE_WORKER_ENVIRONMENT_NAME;
|
|
63
|
+
if ('node' === target || isServiceWorker) {
|
|
64
|
+
const extensionAlias = {
|
|
65
|
+
'.js': [
|
|
66
|
+
'.node.js',
|
|
67
|
+
'.server.js',
|
|
68
|
+
'.js'
|
|
69
|
+
],
|
|
70
|
+
'.jsx': [
|
|
71
|
+
'.node.jsx',
|
|
72
|
+
'.server.jsx',
|
|
73
|
+
'.jsx'
|
|
74
|
+
],
|
|
75
|
+
'.ts': [
|
|
76
|
+
'.node.ts',
|
|
77
|
+
'.server.ts',
|
|
78
|
+
'.ts'
|
|
79
|
+
],
|
|
80
|
+
'.tsx': [
|
|
81
|
+
'.node.tsx',
|
|
82
|
+
'.server.tsx',
|
|
83
|
+
'.tsx'
|
|
84
|
+
],
|
|
85
|
+
'.mjs': [
|
|
86
|
+
'.node.mjs',
|
|
87
|
+
'.server.mjs',
|
|
88
|
+
'.mjs'
|
|
89
|
+
],
|
|
90
|
+
'.json': [
|
|
91
|
+
'.node.json',
|
|
92
|
+
'.server.json',
|
|
93
|
+
'.json'
|
|
94
|
+
]
|
|
95
|
+
};
|
|
96
|
+
config.resolve ??= {};
|
|
97
|
+
config.resolve.extensionAlias = {
|
|
98
|
+
...config.resolve.extensionAlias,
|
|
99
|
+
...extensionAlias
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function applyNodeCompat(isServiceWorker, chain) {
|
|
106
|
+
const nodeExts = [
|
|
107
|
+
'.node.js',
|
|
108
|
+
'.node.jsx',
|
|
109
|
+
'.node.ts',
|
|
110
|
+
'.node.tsx',
|
|
111
|
+
'.node.mjs',
|
|
112
|
+
'.server.js',
|
|
113
|
+
'.server.jsx',
|
|
114
|
+
'.server.ts',
|
|
115
|
+
'.server.tsx',
|
|
116
|
+
'.server.mjs'
|
|
117
|
+
];
|
|
118
|
+
const webWorkerExts = [
|
|
119
|
+
'.worker.js',
|
|
120
|
+
'.worker.jsx',
|
|
121
|
+
'.worker.ts',
|
|
122
|
+
'.worker.tsx'
|
|
123
|
+
];
|
|
124
|
+
for (const ext of nodeExts)chain.resolve.extensions.prepend(ext);
|
|
125
|
+
if (isServiceWorker) for (const ext of webWorkerExts)chain.resolve.extensions.prepend(ext);
|
|
126
|
+
}
|
|
127
|
+
exports.builderPluginAdapterBasic = __webpack_exports__.builderPluginAdapterBasic;
|
|
128
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
129
|
+
"builderPluginAdapterBasic"
|
|
130
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
131
|
+
Object.defineProperty(exports, '__esModule', {
|
|
132
|
+
value: true
|
|
133
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
builderPluginAdapterHtml: ()=>builderPluginAdapterHtml
|
|
28
|
+
});
|
|
29
|
+
const builder_namespaceObject = require("@modern-js/builder");
|
|
30
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
31
|
+
const lodash_namespaceObject = require("@modern-js/utils/lodash");
|
|
32
|
+
const index_js_namespaceObject = require("../bundlerPlugins/index.js");
|
|
33
|
+
const createVirtualModule = (content)=>`data:text/javascript;charset=utf-8,${encodeURIComponent(content)}`;
|
|
34
|
+
const builderPluginAdapterHtml = (options)=>({
|
|
35
|
+
name: 'builder-plugin-adapter-modern-html',
|
|
36
|
+
setup (api) {
|
|
37
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID, target, HtmlPlugin: HtmlBundlerPlugin, environment })=>{
|
|
38
|
+
const builderConfig = environment.config;
|
|
39
|
+
if (!(0, builder_namespaceObject.isHtmlDisabled)(builderConfig, target)) {
|
|
40
|
+
applyBottomHtmlPlugin({
|
|
41
|
+
options,
|
|
42
|
+
chain,
|
|
43
|
+
CHAIN_ID,
|
|
44
|
+
HtmlBundlerPlugin,
|
|
45
|
+
htmlPaths: environment.htmlPaths
|
|
46
|
+
});
|
|
47
|
+
await injectAssetPrefix({
|
|
48
|
+
chain
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
async function injectAssetPrefix({ chain }) {
|
|
55
|
+
const entries = chain.entryPoints.entries() || {};
|
|
56
|
+
const entryNames = Object.keys(entries);
|
|
57
|
+
const assetPrefix = (0, utils_namespaceObject.removeTailSlash)(chain.output.get('publicPath') || '');
|
|
58
|
+
const code = `window.__assetPrefix__ = '${assetPrefix}';`;
|
|
59
|
+
entryNames.forEach((entryName)=>{
|
|
60
|
+
entries[entryName].prepend(createVirtualModule(code));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function applyBottomHtmlPlugin({ chain, options, CHAIN_ID, HtmlBundlerPlugin, htmlPaths }) {
|
|
64
|
+
const { normalizedConfig: modernConfig, appContext } = options;
|
|
65
|
+
for (const entryName of Object.keys(htmlPaths)){
|
|
66
|
+
const baseTemplateParams = {
|
|
67
|
+
entryName,
|
|
68
|
+
title: modernConfig.html.title,
|
|
69
|
+
mountId: modernConfig.html.templateParameters
|
|
70
|
+
};
|
|
71
|
+
chain.plugin(`${CHAIN_ID.PLUGIN.HTML}-${entryName}`).tap((args)=>[
|
|
72
|
+
{
|
|
73
|
+
...args[0] || {},
|
|
74
|
+
__internal__: true,
|
|
75
|
+
bottomTemplate: appContext.htmlTemplates[`__${entryName}-bottom__`] && (0, lodash_namespaceObject.template)(appContext.htmlTemplates[`__${entryName}-bottom__`])(baseTemplateParams)
|
|
76
|
+
}
|
|
77
|
+
]);
|
|
78
|
+
}
|
|
79
|
+
chain.plugin('bottom-template').use(index_js_namespaceObject.BottomTemplatePlugin, [
|
|
80
|
+
HtmlBundlerPlugin
|
|
81
|
+
]);
|
|
82
|
+
}
|
|
83
|
+
exports.builderPluginAdapterHtml = __webpack_exports__.builderPluginAdapterHtml;
|
|
84
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
85
|
+
"builderPluginAdapterHtml"
|
|
86
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
87
|
+
Object.defineProperty(exports, '__esModule', {
|
|
88
|
+
value: true
|
|
89
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
builderPluginAdapterSSR: ()=>builderPluginAdapterSSR
|
|
28
|
+
});
|
|
29
|
+
const external_path_namespaceObject = require("path");
|
|
30
|
+
const builder_namespaceObject = require("@modern-js/builder");
|
|
31
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
32
|
+
const core_namespaceObject = require("@rsbuild/core");
|
|
33
|
+
const utils_js_namespaceObject = require("../../../plugins/analyze/utils.js");
|
|
34
|
+
const index_js_namespaceObject = require("../bundlerPlugins/index.js");
|
|
35
|
+
const builderPluginAdapterSSR = (options)=>({
|
|
36
|
+
name: 'builder-plugin-adapter-modern-ssr',
|
|
37
|
+
setup (api) {
|
|
38
|
+
const { normalizedConfig } = options;
|
|
39
|
+
api.modifyRsbuildConfig((config)=>(0, core_namespaceObject.mergeRsbuildConfig)(config, {
|
|
40
|
+
html: {
|
|
41
|
+
inject: isStreamingSSR(normalizedConfig) ? 'head' : void 0
|
|
42
|
+
},
|
|
43
|
+
server: {
|
|
44
|
+
compress: isStreamingSSR(normalizedConfig) || (0, utils_namespaceObject.isUseRsc)(normalizedConfig) ? false : void 0
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
api.modifyBundlerChain(async (chain, { target, isProd, HtmlPlugin: HtmlBundlerPlugin, isServer, environment })=>{
|
|
48
|
+
const builderConfig = environment.config;
|
|
49
|
+
const { normalizedConfig } = options;
|
|
50
|
+
applyRouterPlugin(chain, 'route-plugin', options, HtmlBundlerPlugin);
|
|
51
|
+
const isServiceWorker = environment.name === builder_namespaceObject.SERVICE_WORKER_ENVIRONMENT_NAME;
|
|
52
|
+
if ('node' === target || isServiceWorker) applyFilterEntriesBySSRConfig({
|
|
53
|
+
isProd,
|
|
54
|
+
chain,
|
|
55
|
+
appNormalizedConfig: normalizedConfig
|
|
56
|
+
});
|
|
57
|
+
if ((0, utils_namespaceObject.isUseSSRBundle)(normalizedConfig) || (0, utils_namespaceObject.isUseRsc)(normalizedConfig)) {
|
|
58
|
+
await applySSRLoaderEntry(chain, options, isServer);
|
|
59
|
+
applySSRDataLoader(chain, options);
|
|
60
|
+
}
|
|
61
|
+
if (!(0, builder_namespaceObject.isHtmlDisabled)(builderConfig, target)) applyAsyncChunkHtmlPlugin({
|
|
62
|
+
chain,
|
|
63
|
+
modernConfig: options.normalizedConfig,
|
|
64
|
+
HtmlBundlerPlugin
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const isStreamingSSR = (userConfig)=>{
|
|
70
|
+
const isStreaming = (ssr)=>{
|
|
71
|
+
if (!ssr) return false;
|
|
72
|
+
if ('boolean' == typeof ssr) return ssr;
|
|
73
|
+
return 'string' !== ssr.mode;
|
|
74
|
+
};
|
|
75
|
+
const { server } = userConfig;
|
|
76
|
+
if (isStreaming(server.ssr)) return true;
|
|
77
|
+
if (server?.ssrByEntries && 'object' == typeof server.ssrByEntries) {
|
|
78
|
+
for (const name of Object.keys(server.ssrByEntries))if (isStreaming(server.ssrByEntries[name])) return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
};
|
|
82
|
+
function applyAsyncChunkHtmlPlugin({ chain, modernConfig, HtmlBundlerPlugin }) {
|
|
83
|
+
if (isStreamingSSR(modernConfig) || (0, utils_namespaceObject.isUseRsc)(modernConfig)) chain.plugin('html-async-chunk').use(index_js_namespaceObject.HtmlAsyncChunkPlugin, [
|
|
84
|
+
HtmlBundlerPlugin
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
function applyRouterPlugin(chain, pluginName, options, HtmlBundlerPlugin) {
|
|
88
|
+
const { appContext, normalizedConfig } = options;
|
|
89
|
+
const { entrypoints } = appContext;
|
|
90
|
+
const existNestedRoutes = entrypoints.some((entrypoint)=>entrypoint.nestedRoutesEntry);
|
|
91
|
+
const workerSSR = Boolean(normalizedConfig.deploy.worker?.ssr);
|
|
92
|
+
const { enableInlineRouteManifests, disableInlineRouteManifests } = normalizedConfig.output;
|
|
93
|
+
const inlineRouteManifests = disableInlineRouteManifests ? !disableInlineRouteManifests : enableInlineRouteManifests;
|
|
94
|
+
if (existNestedRoutes || workerSSR) chain.plugin(pluginName).use(index_js_namespaceObject.RouterPlugin, [
|
|
95
|
+
{
|
|
96
|
+
HtmlBundlerPlugin,
|
|
97
|
+
enableInlineRouteManifests: inlineRouteManifests,
|
|
98
|
+
staticJsDir: normalizedConfig.output?.distPath?.js,
|
|
99
|
+
disableFilenameHash: normalizedConfig.output?.filenameHash === false,
|
|
100
|
+
scriptLoading: normalizedConfig.html?.scriptLoading,
|
|
101
|
+
nonce: normalizedConfig.security?.nonce
|
|
102
|
+
}
|
|
103
|
+
]);
|
|
104
|
+
}
|
|
105
|
+
function applyFilterEntriesBySSRConfig({ isProd, chain, appNormalizedConfig }) {
|
|
106
|
+
const { server: serverConfig, output: outputConfig } = appNormalizedConfig;
|
|
107
|
+
const entries = chain.entryPoints.entries();
|
|
108
|
+
if (isProd && (outputConfig?.ssg === true || 'function' == typeof outputConfig?.ssg)) return;
|
|
109
|
+
if (void 0 === entries) throw new Error('No entry found, one of src/routes/layout.tsx, src/App.tsx, src/index.tsx is required');
|
|
110
|
+
const entryNames = Object.keys(entries);
|
|
111
|
+
if (isProd && 1 === entryNames.length && outputConfig?.ssg) return;
|
|
112
|
+
const ssgEntries = [];
|
|
113
|
+
if (isProd && outputConfig?.ssgByEntries) {
|
|
114
|
+
const { ssgByEntries } = outputConfig;
|
|
115
|
+
entryNames.forEach((name)=>{
|
|
116
|
+
if (ssgByEntries[name]) ssgEntries.push(name);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const { ssr, ssrByEntries } = serverConfig || {};
|
|
120
|
+
entryNames.forEach((name)=>{
|
|
121
|
+
if (!serverConfig?.rsc && !ssgEntries.includes(name) && !name.includes('server-loaders') && (ssr && ssrByEntries?.[name] === false || !ssr && !ssrByEntries?.[name])) chain.entryPoints.delete(name);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
async function applySSRLoaderEntry(chain, optinos, isServer) {
|
|
125
|
+
const { appContext } = optinos;
|
|
126
|
+
const { internalDirectory } = appContext;
|
|
127
|
+
const { entrypoints } = appContext;
|
|
128
|
+
await Promise.all(entrypoints.map(async (entrypoint)=>{
|
|
129
|
+
const { entryName } = entrypoint;
|
|
130
|
+
const serverLoadersFile = (0, utils_js_namespaceObject.getServerCombinedModueFile)(internalDirectory, entryName);
|
|
131
|
+
if (isServer) try {
|
|
132
|
+
await utils_namespaceObject.fs.access(serverLoadersFile, utils_namespaceObject.fs.constants.F_OK);
|
|
133
|
+
chain.entry(`${entryName}-server-loaders`).add(serverLoadersFile);
|
|
134
|
+
} catch (err) {}
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
function applySSRDataLoader(chain, options) {
|
|
138
|
+
const { normalizedConfig, appContext } = options;
|
|
139
|
+
const { appDirectory } = appContext;
|
|
140
|
+
const { entriesDir = './src' } = normalizedConfig.source;
|
|
141
|
+
const absolutePath = external_path_namespaceObject.resolve(appDirectory, entriesDir).split(external_path_namespaceObject.sep).join('(\\\\|/)');
|
|
142
|
+
const reg = new RegExp(`${absolutePath}.*\\.(loader|data|data.client)\\.[t|j]sx?$`);
|
|
143
|
+
chain.module.rule('ssr-data-loader').test(reg).use('data-loader').loader(require.resolve('@modern-js/plugin-data-loader/loader')).end();
|
|
144
|
+
}
|
|
145
|
+
exports.builderPluginAdapterSSR = __webpack_exports__.builderPluginAdapterSSR;
|
|
146
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
147
|
+
"builderPluginAdapterSSR"
|
|
148
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
149
|
+
Object.defineProperty(exports, '__esModule', {
|
|
150
|
+
value: true
|
|
151
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
builderPluginAdapterHooks: ()=>builderPluginAdapterHooks
|
|
28
|
+
});
|
|
29
|
+
const builderPluginAdapterHooks = (options)=>({
|
|
30
|
+
name: 'builder-plugin-support-modern-hooks',
|
|
31
|
+
setup (api) {
|
|
32
|
+
const _internalContext = options.appContext._internalContext;
|
|
33
|
+
const hooks = _internalContext.pluginAPI?.getHooks();
|
|
34
|
+
api.modifyBundlerChain(async (chain, utils)=>{
|
|
35
|
+
await hooks?.modifyBundlerChain.call(chain, utils);
|
|
36
|
+
});
|
|
37
|
+
api.modifyRsbuildConfig(async (config, utils)=>{
|
|
38
|
+
await hooks?.modifyRsbuildConfig.call(config, utils);
|
|
39
|
+
});
|
|
40
|
+
api.modifyRspackConfig(async (config, utils)=>{
|
|
41
|
+
await hooks?.modifyRspackConfig.call(config, utils);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
exports.builderPluginAdapterHooks = __webpack_exports__.builderPluginAdapterHooks;
|
|
46
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
47
|
+
"builderPluginAdapterHooks"
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
|
+
Object.defineProperty(exports, '__esModule', {
|
|
50
|
+
value: true
|
|
51
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./adapterBasic" (module) {
|
|
4
|
+
module.exports = require("./adapterBasic.js");
|
|
5
|
+
},
|
|
6
|
+
"./adapterHtml" (module) {
|
|
7
|
+
module.exports = require("./adapterHtml.js");
|
|
8
|
+
},
|
|
9
|
+
"./adapterSSR" (module) {
|
|
10
|
+
module.exports = require("./adapterSSR.js");
|
|
11
|
+
},
|
|
12
|
+
"./builderHooks" (module) {
|
|
13
|
+
module.exports = require("./builderHooks.js");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __webpack_module_cache__ = {};
|
|
17
|
+
function __webpack_require__(moduleId) {
|
|
18
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
19
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
20
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
21
|
+
exports: {}
|
|
22
|
+
};
|
|
23
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
24
|
+
return module.exports;
|
|
25
|
+
}
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.n = (module)=>{
|
|
28
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
29
|
+
__webpack_require__.d(getter, {
|
|
30
|
+
a: getter
|
|
31
|
+
});
|
|
32
|
+
return getter;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
(()=>{
|
|
36
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
37
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: definition[key]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
(()=>{
|
|
44
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
45
|
+
})();
|
|
46
|
+
(()=>{
|
|
47
|
+
__webpack_require__.r = (exports1)=>{
|
|
48
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
49
|
+
value: 'Module'
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
52
|
+
value: true
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
var __webpack_exports__ = {};
|
|
57
|
+
(()=>{
|
|
58
|
+
__webpack_require__.r(__webpack_exports__);
|
|
59
|
+
var _adapterBasic__rspack_import_0 = __webpack_require__("./adapterBasic");
|
|
60
|
+
var __rspack_reexport = {};
|
|
61
|
+
for(const __rspack_import_key in _adapterBasic__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_adapterBasic__rspack_import_0[__rspack_import_key];
|
|
62
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
63
|
+
var _adapterHtml__rspack_import_1 = __webpack_require__("./adapterHtml");
|
|
64
|
+
var __rspack_reexport = {};
|
|
65
|
+
for(const __rspack_import_key in _adapterHtml__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_adapterHtml__rspack_import_1[__rspack_import_key];
|
|
66
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
67
|
+
var _adapterSSR__rspack_import_2 = __webpack_require__("./adapterSSR");
|
|
68
|
+
var __rspack_reexport = {};
|
|
69
|
+
for(const __rspack_import_key in _adapterSSR__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_adapterSSR__rspack_import_2[__rspack_import_key];
|
|
70
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
71
|
+
var _builderHooks__rspack_import_3 = __webpack_require__("./builderHooks");
|
|
72
|
+
var __rspack_reexport = {};
|
|
73
|
+
for(const __rspack_import_key in _builderHooks__rspack_import_3)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_builderHooks__rspack_import_3[__rspack_import_key];
|
|
74
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
75
|
+
})();
|
|
76
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
77
|
+
Object.defineProperty(exports, '__esModule', {
|
|
78
|
+
value: true
|
|
79
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
HtmlAsyncChunkPlugin: ()=>HtmlAsyncChunkPlugin
|
|
28
|
+
});
|
|
29
|
+
const builder_namespaceObject = require("@modern-js/builder");
|
|
30
|
+
class HtmlAsyncChunkPlugin {
|
|
31
|
+
apply(compiler) {
|
|
32
|
+
compiler.hooks.compilation.tap(this.name, (compilation)=>{
|
|
33
|
+
const hooks = this.htmlPlugin.getCompilationHooks(compilation);
|
|
34
|
+
hooks.alterAssetTagGroups.tap(this.name, (assets)=>{
|
|
35
|
+
const headTags = [];
|
|
36
|
+
const bodyTags = [];
|
|
37
|
+
const processScriptTag = (tag)=>{
|
|
38
|
+
const { attributes } = tag;
|
|
39
|
+
if (attributes && true === attributes.defer) {
|
|
40
|
+
attributes.async = true;
|
|
41
|
+
delete attributes.defer;
|
|
42
|
+
}
|
|
43
|
+
const src = attributes?.src;
|
|
44
|
+
const isRuntimeChunk = src && builder_namespaceObject.RUNTIME_CHUNK_REGEX.test(src);
|
|
45
|
+
return isRuntimeChunk ? bodyTags : headTags;
|
|
46
|
+
};
|
|
47
|
+
for (const tag of [
|
|
48
|
+
...assets.headTags,
|
|
49
|
+
...assets.bodyTags
|
|
50
|
+
])if ("script" === tag.tagName) processScriptTag(tag).push(tag);
|
|
51
|
+
else (assets.headTags.includes(tag) ? headTags : bodyTags).push(tag);
|
|
52
|
+
return {
|
|
53
|
+
...assets,
|
|
54
|
+
headTags,
|
|
55
|
+
bodyTags
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
constructor(htmlPlugin){
|
|
61
|
+
this.name = 'HtmlAsyncChunkPlugin';
|
|
62
|
+
this.htmlPlugin = htmlPlugin;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.HtmlAsyncChunkPlugin = __webpack_exports__.HtmlAsyncChunkPlugin;
|
|
66
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
67
|
+
"HtmlAsyncChunkPlugin"
|
|
68
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
69
|
+
Object.defineProperty(exports, '__esModule', {
|
|
70
|
+
value: true
|
|
71
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
BottomTemplatePlugin: ()=>BottomTemplatePlugin
|
|
28
|
+
});
|
|
29
|
+
class BottomTemplatePlugin {
|
|
30
|
+
apply(compiler) {
|
|
31
|
+
compiler.hooks.compilation.tap(this.name, (compilation)=>{
|
|
32
|
+
this.htmlPlugin.getCompilationHooks(compilation).beforeEmit.tap(this.name, (data)=>{
|
|
33
|
+
if (!data.plugin.options?.__internal__) return data;
|
|
34
|
+
if (this.bottomTemplateReg.test(data.html)) {
|
|
35
|
+
data.html = data.html.replace(this.bottomTemplateReg, '');
|
|
36
|
+
const { bottomTemplate } = data.plugin.options;
|
|
37
|
+
if (bottomTemplate) data.html = data.html.replace(this.bodyRegExp, (match)=>`\n${bottomTemplate}\n${match}`);
|
|
38
|
+
}
|
|
39
|
+
return data;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
constructor(htmlPlugin){
|
|
44
|
+
this.bottomTemplateReg = /<!--<\?-\s*bottomTemplate\s*\?>-->/;
|
|
45
|
+
this.bodyRegExp = /(<\/\s*body\s*>)/i;
|
|
46
|
+
this.htmlPlugin = htmlPlugin;
|
|
47
|
+
this.name = 'bottom-template';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.BottomTemplatePlugin = __webpack_exports__.BottomTemplatePlugin;
|
|
51
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
52
|
+
"BottomTemplatePlugin"
|
|
53
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
54
|
+
Object.defineProperty(exports, '__esModule', {
|
|
55
|
+
value: true
|
|
56
|
+
});
|