@bleedingdev/modern-js-app-tools 3.2.0-ultramodern.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 +21 -0
- package/README.md +26 -0
- package/bin/modern.js +36 -0
- package/dist/cjs/baseline.js +83 -0
- 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 +100 -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 +80 -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/adapterPrecompress.js +112 -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 +86 -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 +107 -0
- package/dist/cjs/commands/deploy.js +44 -0
- package/dist/cjs/commands/dev.js +121 -0
- package/dist/cjs/commands/index.js +99 -0
- package/dist/cjs/commands/info.js +110 -0
- package/dist/cjs/commands/inspect.js +49 -0
- package/dist/cjs/commands/runtime.js +159 -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 +125 -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 +48 -0
- package/dist/cjs/esm/register-esm.mjs +10 -0
- package/dist/cjs/esm/ts-paths-loader.js +73 -0
- package/dist/cjs/esm/ts-paths-loader.mjs +35 -0
- package/dist/cjs/exports/server.js +18 -0
- package/dist/cjs/index.js +358 -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 +144 -0
- package/dist/cjs/plugins/analyze/getServerRoutes.js +177 -0
- package/dist/cjs/plugins/analyze/index.js +237 -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 +126 -0
- package/dist/cjs/plugins/deploy/index.js +77 -0
- package/dist/cjs/plugins/deploy/platforms/gh-pages.js +87 -0
- package/dist/cjs/plugins/deploy/platforms/netlify.js +140 -0
- package/dist/cjs/plugins/deploy/platforms/node.js +100 -0
- package/dist/cjs/plugins/deploy/platforms/platform.js +18 -0
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +57 -0
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +59 -0
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +44 -0
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +46 -0
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +57 -0
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +58 -0
- package/dist/cjs/plugins/deploy/platforms/vercel.js +159 -0
- package/dist/cjs/plugins/deploy/types.js +18 -0
- package/dist/cjs/plugins/deploy/utils/generator.js +104 -0
- package/dist/cjs/plugins/deploy/utils/index.js +123 -0
- package/dist/cjs/plugins/initialize/index.js +93 -0
- package/dist/cjs/plugins/serverBuild.js +90 -0
- package/dist/cjs/plugins/serverRuntime.js +49 -0
- package/dist/cjs/presetUltramodern.js +41 -0
- package/dist/cjs/rsbuild.js +90 -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/ultramodern/designSystem.js +119 -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 +128 -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/baseline.mjs +46 -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 +66 -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 +46 -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/adapterPrecompress.mjs +68 -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 +5 -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/builder/shared/types.mjs +0 -0
- package/dist/esm/commands/build.mjs +63 -0
- package/dist/esm/commands/deploy.mjs +10 -0
- package/dist/esm/commands/dev.mjs +77 -0
- package/dist/esm/commands/index.mjs +47 -0
- package/dist/esm/commands/info.mjs +76 -0
- package/dist/esm/commands/inspect.mjs +15 -0
- package/dist/esm/commands/runtime.mjs +116 -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 +91 -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 +11 -0
- package/dist/esm/esm/ts-paths-loader.mjs +36 -0
- package/dist/esm/exports/server.mjs +0 -0
- package/dist/esm/index.mjs +131 -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 +97 -0
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +130 -0
- package/dist/esm/plugins/analyze/index.mjs +203 -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 +63 -0
- package/dist/esm/plugins/deploy/index.mjs +43 -0
- package/dist/esm/plugins/deploy/platforms/gh-pages.mjs +43 -0
- package/dist/esm/plugins/deploy/platforms/netlify.mjs +96 -0
- package/dist/esm/plugins/deploy/platforms/node.mjs +56 -0
- package/dist/esm/plugins/deploy/platforms/platform.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +57 -0
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +59 -0
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +44 -0
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +46 -0
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +57 -0
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +58 -0
- package/dist/esm/plugins/deploy/platforms/vercel.mjs +115 -0
- package/dist/esm/plugins/deploy/types.mjs +0 -0
- package/dist/esm/plugins/deploy/utils/generator.mjs +48 -0
- package/dist/esm/plugins/deploy/utils/index.mjs +67 -0
- package/dist/esm/plugins/initialize/index.mjs +59 -0
- package/dist/esm/plugins/serverBuild.mjs +45 -0
- package/dist/esm/plugins/serverRuntime.mjs +15 -0
- package/dist/esm/presetUltramodern.mjs +4 -0
- package/dist/esm/rsbuild.mjs +47 -0
- package/dist/esm/rslib-runtime.mjs +18 -0
- package/dist/esm/run/index.mjs +61 -0
- package/dist/esm/types/config/deploy.mjs +0 -0
- package/dist/esm/types/config/dev.mjs +0 -0
- package/dist/esm/types/config/experiments.mjs +0 -0
- package/dist/esm/types/config/html.mjs +0 -0
- package/dist/esm/types/config/index.mjs +1 -0
- package/dist/esm/types/config/output.mjs +0 -0
- package/dist/esm/types/config/performance.mjs +0 -0
- package/dist/esm/types/config/resolve.mjs +0 -0
- package/dist/esm/types/config/security.mjs +0 -0
- package/dist/esm/types/config/source.mjs +0 -0
- package/dist/esm/types/config/testing.mjs +0 -0
- package/dist/esm/types/config/tools.mjs +0 -0
- package/dist/esm/types/index.mjs +1 -0
- package/dist/esm/types/plugin.mjs +0 -0
- package/dist/esm/types/utils.mjs +0 -0
- package/dist/esm/ultramodern/designSystem.mjs +73 -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 +81 -0
- package/dist/esm/utils/restart.mjs +18 -0
- package/dist/esm/utils/routes.mjs +15 -0
- package/dist/esm/utils/types.mjs +0 -0
- package/dist/esm-node/baseline.mjs +47 -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 +67 -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 +47 -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/adapterPrecompress.mjs +69 -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 +6 -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 +64 -0
- package/dist/esm-node/commands/deploy.mjs +11 -0
- package/dist/esm-node/commands/dev.mjs +78 -0
- package/dist/esm-node/commands/index.mjs +48 -0
- package/dist/esm-node/commands/info.mjs +77 -0
- package/dist/esm-node/commands/inspect.mjs +16 -0
- package/dist/esm-node/commands/runtime.mjs +117 -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 +92 -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 +12 -0
- package/dist/esm-node/esm/ts-paths-loader.mjs +37 -0
- package/dist/esm-node/exports/server.mjs +1 -0
- package/dist/esm-node/index.mjs +133 -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 +98 -0
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +131 -0
- package/dist/esm-node/plugins/analyze/index.mjs +204 -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 +64 -0
- package/dist/esm-node/plugins/deploy/index.mjs +44 -0
- package/dist/esm-node/plugins/deploy/platforms/gh-pages.mjs +44 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify.mjs +98 -0
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +58 -0
- package/dist/esm-node/plugins/deploy/platforms/platform.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +57 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +59 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +44 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +46 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +57 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +58 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel.mjs +117 -0
- package/dist/esm-node/plugins/deploy/types.mjs +1 -0
- package/dist/esm-node/plugins/deploy/utils/generator.mjs +49 -0
- package/dist/esm-node/plugins/deploy/utils/index.mjs +71 -0
- package/dist/esm-node/plugins/initialize/index.mjs +60 -0
- package/dist/esm-node/plugins/serverBuild.mjs +46 -0
- package/dist/esm-node/plugins/serverRuntime.mjs +16 -0
- package/dist/esm-node/presetUltramodern.mjs +5 -0
- package/dist/esm-node/rsbuild.mjs +48 -0
- package/dist/esm-node/rslib-runtime.mjs +19 -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/ultramodern/designSystem.mjs +74 -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 +83 -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/baseline.d.ts +46 -0
- package/dist/types/builder/builder-rspack/index.d.ts +2 -0
- package/dist/types/builder/generator/adapterCopy.d.ts +3 -0
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -0
- 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 +8 -0
- package/dist/types/builder/index.d.ts +3 -0
- 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/adapterPrecompress.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 +5 -0
- package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +7 -0
- package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +9 -0
- 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 +3 -0
- package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +3 -0
- package/dist/types/builder/shared/types.d.ts +6 -0
- package/dist/types/commands/build.d.ts +4 -0
- package/dist/types/commands/deploy.d.ts +3 -0
- package/dist/types/commands/dev.d.ts +9 -0
- package/dist/types/commands/index.d.ts +10 -0
- package/dist/types/commands/info.d.ts +18 -0
- package/dist/types/commands/inspect.d.ts +4 -0
- package/dist/types/commands/runtime.d.ts +11 -0
- package/dist/types/commands/serve.d.ts +8 -0
- 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 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/initialize/index.d.ts +3 -0
- package/dist/types/config/initialize/inits.d.ts +4 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/defineConfig.d.ts +11 -0
- package/dist/types/esm/register-esm.d.mts +11 -0
- package/dist/types/esm/ts-node-loader.d.mts +6 -0
- package/dist/types/esm/ts-paths-loader.d.mts +6 -0
- package/dist/types/exports/server.d.ts +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/locale/en.d.ts +44 -0
- package/dist/types/locale/index.d.ts +90 -0
- package/dist/types/locale/zh.d.ts +44 -0
- 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/plugins/analyze/isDefaultExportFunction.d.ts +1 -0
- 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.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/node.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/platform.d.ts +17 -0
- package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +2 -0
- package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.mts +2 -0
- package/dist/types/plugins/deploy/platforms/templates/node-entry.d.cts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/node-entry.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.cts +2 -0
- package/dist/types/plugins/deploy/platforms/templates/vercel-entry.d.mts +2 -0
- package/dist/types/plugins/deploy/platforms/vercel.d.ts +2 -0
- package/dist/types/plugins/deploy/types.d.ts +3 -0
- package/dist/types/plugins/deploy/utils/generator.d.ts +24 -0
- package/dist/types/plugins/deploy/utils/index.d.ts +16 -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/presetUltramodern.d.ts +6 -0
- package/dist/types/rsbuild.d.ts +12 -0
- package/dist/types/run/index.d.ts +20 -0
- package/dist/types/types/config/deploy.d.ts +38 -0
- package/dist/types/types/config/dev.d.ts +55 -0
- package/dist/types/types/config/experiments.d.ts +3 -0
- package/dist/types/types/config/html.d.ts +3 -0
- package/dist/types/types/config/index.d.ts +48 -0
- package/dist/types/types/config/output.d.ts +61 -0
- package/dist/types/types/config/performance.d.ts +3 -0
- package/dist/types/types/config/resolve.d.ts +2 -0
- package/dist/types/types/config/security.d.ts +2 -0
- package/dist/types/types/config/source.d.ts +61 -0
- package/dist/types/types/config/testing.d.ts +8 -0
- package/dist/types/types/config/tools.d.ts +21 -0
- package/dist/types/types/index.d.ts +10 -0
- package/dist/types/types/plugin.d.ts +114 -0
- package/dist/types/types/utils.d.ts +1 -0
- package/dist/types/ultramodern/designSystem.d.ts +54 -0
- package/dist/types/utils/config.d.ts +2 -0
- package/dist/types/utils/createServer.d.ts +5 -0
- package/dist/types/utils/env.d.ts +2 -0
- package/dist/types/utils/generateWatchFiles.d.ts +2 -0
- package/dist/types/utils/getConfigFile.d.ts +1 -0
- package/dist/types/utils/getSelectedEntries.d.ts +5 -0
- package/dist/types/utils/initAppContext.d.ts +31 -0
- package/dist/types/utils/loadPlugins.d.ts +13 -0
- package/dist/types/utils/printInstructions.d.ts +3 -0
- package/dist/types/utils/register.d.ts +19 -0
- package/dist/types/utils/restart.d.ts +2 -0
- package/dist/types/utils/routes.d.ts +4 -0
- package/dist/types/utils/types.d.ts +49 -0
- package/lib/types.d.ts +252 -0
- package/package.json +138 -0
- package/rslib.config.mts +39 -0
- package/rstest.config.mts +20 -0
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
RouterPlugin: ()=>RouterPlugin
|
|
28
|
+
});
|
|
29
|
+
const utils_namespaceObject = require("@modern-js/utils");
|
|
30
|
+
const lodash_namespaceObject = require("@modern-js/utils/lodash");
|
|
31
|
+
const constants_namespaceObject = require("@modern-js/utils/universal/constants");
|
|
32
|
+
const external_crypto_namespaceObject = require("crypto");
|
|
33
|
+
const PLUGIN_NAME = 'ModernjsRoutePlugin';
|
|
34
|
+
const generateContentHash = (content)=>(0, external_crypto_namespaceObject.createHash)('md5').update(content).digest('hex').slice(0, 8);
|
|
35
|
+
class RouterPlugin {
|
|
36
|
+
isTargetNodeOrWebWorker(target) {
|
|
37
|
+
if ('node' === target || Array.isArray(target) && target.includes('node')) return true;
|
|
38
|
+
if ('webworker' === target || Array.isArray(target) && target.includes('webworker')) return true;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
getEntryChunks(compilation, chunks) {
|
|
42
|
+
const entrypointsArray = Array.from(compilation.entrypoints.entries());
|
|
43
|
+
const entryChunkIds = entrypointsArray.map((entrypoint)=>entrypoint[0]);
|
|
44
|
+
const entryChunks = [
|
|
45
|
+
...chunks
|
|
46
|
+
].filter((chunk)=>chunk.names?.some((name)=>entryChunkIds.includes(name)));
|
|
47
|
+
return entryChunks;
|
|
48
|
+
}
|
|
49
|
+
getEntryChunkFiles(entryChunks) {
|
|
50
|
+
return entryChunks.map((chunk)=>[
|
|
51
|
+
...chunk.files || []
|
|
52
|
+
].find((fname)=>fname.includes('.js')));
|
|
53
|
+
}
|
|
54
|
+
apply(compiler) {
|
|
55
|
+
const { target } = compiler.options;
|
|
56
|
+
if (this.isTargetNodeOrWebWorker(target)) return;
|
|
57
|
+
const { rspack } = compiler;
|
|
58
|
+
const { Compilation, sources } = rspack;
|
|
59
|
+
const { RawSource } = sources;
|
|
60
|
+
const normalizePath = (path)=>{
|
|
61
|
+
if (!path.endsWith('/')) return `${path}/`;
|
|
62
|
+
return path;
|
|
63
|
+
};
|
|
64
|
+
const chunksToHtmlName = new Map();
|
|
65
|
+
const ROUTE_MANIFEST_HOLDER = "route-manifest";
|
|
66
|
+
const placeholder = `<!--<?- ${ROUTE_MANIFEST_HOLDER} ?>-->`;
|
|
67
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation)=>{
|
|
68
|
+
this.HtmlBundlerPlugin.getCompilationHooks(compilation).beforeEmit.tapAsync('RouterManifestPlugin', (data, callback)=>{
|
|
69
|
+
const { outputName } = data;
|
|
70
|
+
const { chunks } = data.plugin.options;
|
|
71
|
+
chunksToHtmlName.set(chunks, outputName);
|
|
72
|
+
data.html = data.html.replace("<\/script>", `</script>${placeholder}`);
|
|
73
|
+
callback(null, data);
|
|
74
|
+
});
|
|
75
|
+
compilation.hooks.processAssets.tapPromise({
|
|
76
|
+
name: PLUGIN_NAME,
|
|
77
|
+
stage: Compilation.PROCESS_ASSETS_STAGE_REPORT
|
|
78
|
+
}, async ()=>{
|
|
79
|
+
const stats = compilation.getStats().toJson({
|
|
80
|
+
all: false,
|
|
81
|
+
publicPath: true,
|
|
82
|
+
assets: true,
|
|
83
|
+
chunkGroups: true,
|
|
84
|
+
chunks: true,
|
|
85
|
+
ids: true
|
|
86
|
+
});
|
|
87
|
+
const { publicPath, chunks = [], namedChunkGroups } = stats;
|
|
88
|
+
const routeAssets = {};
|
|
89
|
+
if (!namedChunkGroups) return;
|
|
90
|
+
const prevManifestAsset = compilation.getAsset(utils_namespaceObject.ROUTE_MANIFEST_FILE);
|
|
91
|
+
const prevManifestStr = prevManifestAsset ? prevManifestAsset.source.source().toString() : JSON.stringify({
|
|
92
|
+
routeAssets: {}
|
|
93
|
+
});
|
|
94
|
+
const prevManifest = JSON.parse(prevManifestStr);
|
|
95
|
+
const asyncEntryNames = [];
|
|
96
|
+
for (const [name, chunkGroup] of Object.entries(namedChunkGroups)){
|
|
97
|
+
if (name.startsWith('async-')) asyncEntryNames.push(name);
|
|
98
|
+
const assets = chunkGroup.assets.map((asset)=>{
|
|
99
|
+
const filename = asset.name;
|
|
100
|
+
return publicPath ? normalizePath(publicPath) + filename : filename;
|
|
101
|
+
});
|
|
102
|
+
const referenceCssAssets = assets.filter((asset)=>/\.css$/.test(asset));
|
|
103
|
+
routeAssets[name] = {
|
|
104
|
+
chunkIds: chunkGroup.chunks,
|
|
105
|
+
assets,
|
|
106
|
+
referenceCssAssets
|
|
107
|
+
};
|
|
108
|
+
if (prevManifest.routeAssets[name]) (0, lodash_namespaceObject.mergeWith)(routeAssets[name], prevManifest.routeAssets[name], (obj, source)=>{
|
|
109
|
+
if (Array.isArray(obj)) return obj.concat(source);
|
|
110
|
+
return Object.assign(source, obj);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (asyncEntryNames.length > 0) for (const asyncEntryName of asyncEntryNames){
|
|
114
|
+
const syncEntryName = asyncEntryName.replace('async-', '');
|
|
115
|
+
const syncEntry = routeAssets[syncEntryName];
|
|
116
|
+
const asyncEntry = routeAssets[asyncEntryName];
|
|
117
|
+
(0, lodash_namespaceObject.merge)(syncEntry, asyncEntry);
|
|
118
|
+
}
|
|
119
|
+
const manifest = {
|
|
120
|
+
routeAssets
|
|
121
|
+
};
|
|
122
|
+
const entryNames = Array.from(compilation.entrypoints.keys());
|
|
123
|
+
let entryChunks = [];
|
|
124
|
+
entryChunks = this.getEntryChunks(compilation, chunks);
|
|
125
|
+
const entryChunkFiles = this.getEntryChunkFiles(entryChunks);
|
|
126
|
+
const entryChunkFileIds = entryChunks.map((chunk)=>chunk.id);
|
|
127
|
+
for(let i = 0; i < entryChunkFiles.length; i++){
|
|
128
|
+
const entryName = entryNames[i];
|
|
129
|
+
const file = entryChunkFiles[i];
|
|
130
|
+
const chunkNames = entryChunks[i].names;
|
|
131
|
+
const chunkId = entryChunkFileIds[i];
|
|
132
|
+
const asset = compilation.assets[file];
|
|
133
|
+
if (!asset || !chunkId) continue;
|
|
134
|
+
let relatedAssets = {};
|
|
135
|
+
if (entryChunkFiles.length > 1) Object.keys(routeAssets).forEach((routeId)=>{
|
|
136
|
+
const segments = routeId.split('_');
|
|
137
|
+
const chunkName = segments[0];
|
|
138
|
+
if (chunkNames?.includes(chunkName)) relatedAssets[routeId] = routeAssets[routeId];
|
|
139
|
+
});
|
|
140
|
+
else relatedAssets = routeAssets;
|
|
141
|
+
const manifest = {
|
|
142
|
+
routeAssets: relatedAssets
|
|
143
|
+
};
|
|
144
|
+
const injectedContent = `
|
|
145
|
+
;(function(){
|
|
146
|
+
window.${constants_namespaceObject.ROUTE_MANIFEST} = ${JSON.stringify(manifest, (k, v)=>{
|
|
147
|
+
if (('assets' === k || 'referenceCssAssets' === k) && Array.isArray(v)) return v.map((item)=>item.replace(publicPath, ''));
|
|
148
|
+
return v;
|
|
149
|
+
})};
|
|
150
|
+
})();
|
|
151
|
+
`;
|
|
152
|
+
let htmlName;
|
|
153
|
+
for (const [chunks, name] of chunksToHtmlName.entries())if (Array.isArray(chunkNames) && Array.isArray(chunks) && chunkNames.every((value, index)=>value === chunks[index])) {
|
|
154
|
+
htmlName = name;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
const oldHtml = compilation.assets[htmlName];
|
|
158
|
+
const { enableInlineRouteManifests, disableFilenameHash, staticJsDir, scriptLoading, nonce } = this;
|
|
159
|
+
const nonceAttr = nonce ? `nonce="${nonce}"` : '';
|
|
160
|
+
if (oldHtml) if (enableInlineRouteManifests) compilation.updateAsset(htmlName, new RawSource(oldHtml.source().toString().replace(placeholder, `<script ${nonceAttr}>${injectedContent}</script>`)), void 0);
|
|
161
|
+
else {
|
|
162
|
+
const scriptPath = `${staticJsDir}/${ROUTE_MANIFEST_HOLDER}-${entryName}${disableFilenameHash ? '.js' : `.${generateContentHash(injectedContent)}.js`}`;
|
|
163
|
+
const scriptUrl = `${publicPath}${scriptPath}`;
|
|
164
|
+
const scriptLoadingAttr = 'defer' === scriptLoading ? scriptLoading : 'module' === scriptLoading ? 'type="module"' : '';
|
|
165
|
+
const script = `<script ${scriptLoadingAttr} ${nonceAttr} src="${scriptUrl}"></script>`;
|
|
166
|
+
compilation.updateAsset(htmlName, new RawSource(oldHtml.source().toString().replace(placeholder, script)), void 0);
|
|
167
|
+
compilation.emitAsset(scriptPath, new RawSource(injectedContent));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
if (prevManifestAsset) compilation.updateAsset(utils_namespaceObject.ROUTE_MANIFEST_FILE, new RawSource(JSON.stringify(manifest, null, 2)), void 0);
|
|
171
|
+
else compilation.emitAsset(utils_namespaceObject.ROUTE_MANIFEST_FILE, new RawSource(JSON.stringify(manifest, null, 2)));
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
constructor({ staticJsDir = 'static/js', HtmlBundlerPlugin, enableInlineRouteManifests, disableFilenameHash = false, scriptLoading = 'defer', nonce }){
|
|
176
|
+
this.name = 'RouterPlugin';
|
|
177
|
+
this.HtmlBundlerPlugin = HtmlBundlerPlugin;
|
|
178
|
+
this.enableInlineRouteManifests = enableInlineRouteManifests;
|
|
179
|
+
this.staticJsDir = staticJsDir;
|
|
180
|
+
this.disableFilenameHash = disableFilenameHash;
|
|
181
|
+
this.scriptLoading = scriptLoading;
|
|
182
|
+
this.nonce = nonce;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.RouterPlugin = __webpack_exports__.RouterPlugin;
|
|
186
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
187
|
+
"RouterPlugin"
|
|
188
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
189
|
+
Object.defineProperty(exports, '__esModule', {
|
|
190
|
+
value: true
|
|
191
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./HtmlAsyncChunkPlugin" (module) {
|
|
4
|
+
module.exports = require("./HtmlAsyncChunkPlugin.js");
|
|
5
|
+
},
|
|
6
|
+
"./HtmlBottomTemplate" (module) {
|
|
7
|
+
module.exports = require("./HtmlBottomTemplate.js");
|
|
8
|
+
},
|
|
9
|
+
"./RouterPlugin" (module) {
|
|
10
|
+
module.exports = require("./RouterPlugin.js");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var __webpack_module_cache__ = {};
|
|
14
|
+
function __webpack_require__(moduleId) {
|
|
15
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
16
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
17
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
18
|
+
exports: {}
|
|
19
|
+
};
|
|
20
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
21
|
+
return module.exports;
|
|
22
|
+
}
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.n = (module)=>{
|
|
25
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
26
|
+
__webpack_require__.d(getter, {
|
|
27
|
+
a: getter
|
|
28
|
+
});
|
|
29
|
+
return getter;
|
|
30
|
+
};
|
|
31
|
+
})();
|
|
32
|
+
(()=>{
|
|
33
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
34
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: definition[key]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
(()=>{
|
|
41
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
42
|
+
})();
|
|
43
|
+
(()=>{
|
|
44
|
+
__webpack_require__.r = (exports1)=>{
|
|
45
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
46
|
+
value: 'Module'
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
var __webpack_exports__ = {};
|
|
54
|
+
(()=>{
|
|
55
|
+
__webpack_require__.r(__webpack_exports__);
|
|
56
|
+
var _HtmlAsyncChunkPlugin__rspack_import_0 = __webpack_require__("./HtmlAsyncChunkPlugin");
|
|
57
|
+
var __rspack_reexport = {};
|
|
58
|
+
for(const __rspack_import_key in _HtmlAsyncChunkPlugin__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_HtmlAsyncChunkPlugin__rspack_import_0[__rspack_import_key];
|
|
59
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
60
|
+
var _HtmlBottomTemplate__rspack_import_1 = __webpack_require__("./HtmlBottomTemplate");
|
|
61
|
+
var __rspack_reexport = {};
|
|
62
|
+
for(const __rspack_import_key in _HtmlBottomTemplate__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_HtmlBottomTemplate__rspack_import_1[__rspack_import_key];
|
|
63
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
64
|
+
var _RouterPlugin__rspack_import_2 = __webpack_require__("./RouterPlugin");
|
|
65
|
+
var __rspack_reexport = {};
|
|
66
|
+
for(const __rspack_import_key in _RouterPlugin__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_RouterPlugin__rspack_import_2[__rspack_import_key];
|
|
67
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
68
|
+
})();
|
|
69
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
createCopyInfo: ()=>createCopyInfo
|
|
37
|
+
});
|
|
38
|
+
const server_core_namespaceObject = require("@modern-js/server-core");
|
|
39
|
+
const external_path_namespaceObject = require("path");
|
|
40
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
41
|
+
function createCopyInfo(appContext, config) {
|
|
42
|
+
const configDir = external_path_default().resolve(appContext.appDirectory, config.source.configDir || './config');
|
|
43
|
+
const uploadDir = external_path_default().posix.join(configDir.replace(/\\/g, '/'), 'upload');
|
|
44
|
+
const publicDir = external_path_default().posix.join(configDir.replace(/\\/g, '/'), 'public');
|
|
45
|
+
const customPublicDirPaths = (0, server_core_namespaceObject.resolvePublicDirPaths)(config.server?.publicDir, appContext.appDirectory);
|
|
46
|
+
return {
|
|
47
|
+
configDir,
|
|
48
|
+
uploadDir,
|
|
49
|
+
publicDir,
|
|
50
|
+
customPublicDirs: customPublicDirPaths
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
exports.createCopyInfo = __webpack_exports__.createCopyInfo;
|
|
54
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
55
|
+
"createCopyInfo"
|
|
56
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
57
|
+
Object.defineProperty(exports, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"./builderPlugins" (module) {
|
|
4
|
+
module.exports = require("./builderPlugins/index.js");
|
|
5
|
+
},
|
|
6
|
+
"./createCopyInfo" (module) {
|
|
7
|
+
module.exports = require("./createCopyInfo.js");
|
|
8
|
+
},
|
|
9
|
+
"./types?fbf6" (module) {
|
|
10
|
+
module.exports = require("./types.js");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var __webpack_module_cache__ = {};
|
|
14
|
+
function __webpack_require__(moduleId) {
|
|
15
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
16
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
17
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
18
|
+
exports: {}
|
|
19
|
+
};
|
|
20
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
21
|
+
return module.exports;
|
|
22
|
+
}
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.n = (module)=>{
|
|
25
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
26
|
+
__webpack_require__.d(getter, {
|
|
27
|
+
a: getter
|
|
28
|
+
});
|
|
29
|
+
return getter;
|
|
30
|
+
};
|
|
31
|
+
})();
|
|
32
|
+
(()=>{
|
|
33
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
34
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: definition[key]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
(()=>{
|
|
41
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
42
|
+
})();
|
|
43
|
+
(()=>{
|
|
44
|
+
__webpack_require__.r = (exports1)=>{
|
|
45
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
46
|
+
value: 'Module'
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
49
|
+
value: true
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
})();
|
|
53
|
+
var __webpack_exports__ = {};
|
|
54
|
+
(()=>{
|
|
55
|
+
__webpack_require__.r(__webpack_exports__);
|
|
56
|
+
var _builderPlugins__rspack_import_0 = __webpack_require__("./builderPlugins");
|
|
57
|
+
var __rspack_reexport = {};
|
|
58
|
+
for(const __rspack_import_key in _builderPlugins__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_builderPlugins__rspack_import_0[__rspack_import_key];
|
|
59
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
60
|
+
var _createCopyInfo__rspack_import_1 = __webpack_require__("./createCopyInfo");
|
|
61
|
+
var __rspack_reexport = {};
|
|
62
|
+
for(const __rspack_import_key in _createCopyInfo__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_createCopyInfo__rspack_import_1[__rspack_import_key];
|
|
63
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
64
|
+
var _types__rspack_import_2 = __webpack_require__("./types?fbf6");
|
|
65
|
+
var __rspack_reexport = {};
|
|
66
|
+
for(const __rspack_import_key in _types__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_types__rspack_import_2[__rspack_import_key];
|
|
67
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
68
|
+
})();
|
|
69
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
default: ()=>__rspack_default_export
|
|
28
|
+
});
|
|
29
|
+
function loader() {
|
|
30
|
+
return "module.exports = {}";
|
|
31
|
+
}
|
|
32
|
+
const __rspack_default_export = loader;
|
|
33
|
+
exports["default"] = __webpack_exports__["default"];
|
|
34
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
35
|
+
"default"
|
|
36
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
37
|
+
Object.defineProperty(exports, '__esModule', {
|
|
38
|
+
value: true
|
|
39
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|