@modern-js/app-tools 2.69.5 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/modern.js +2 -8
- package/dist/cjs/builder/builder-rspack/index.js +35 -27
- package/dist/cjs/builder/generator/adapterCopy.js +75 -46
- package/dist/cjs/builder/generator/createBuilderProviderConfig.js +83 -81
- package/dist/cjs/builder/generator/createCopyPattern.js +59 -58
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +80 -82
- package/dist/cjs/builder/generator/index.js +70 -85
- package/dist/cjs/builder/index.js +44 -47
- package/dist/cjs/builder/shared/builderPlugins/adapterBasic.js +106 -83
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +79 -74
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +131 -165
- package/dist/cjs/builder/shared/builderPlugins/builderHooks.js +47 -46
- package/dist/cjs/builder/shared/builderPlugins/index.js +76 -25
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +66 -49
- package/dist/cjs/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +51 -50
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +178 -317
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +69 -23
- package/dist/cjs/builder/shared/createCopyInfo.js +54 -43
- package/dist/cjs/builder/shared/index.js +69 -23
- package/dist/cjs/builder/shared/loaders/serverModuleLoader.js +35 -23
- package/dist/cjs/builder/shared/types.js +17 -15
- package/dist/cjs/commands/build.js +107 -96
- package/dist/cjs/commands/deploy.js +40 -32
- package/dist/cjs/commands/dev.js +122 -141
- package/dist/cjs/commands/index.js +74 -121
- package/dist/cjs/commands/inspect.js +45 -39
- package/dist/cjs/commands/serve.js +87 -84
- package/dist/cjs/compat/hooks.js +97 -177
- package/dist/cjs/compat/index.js +57 -59
- package/dist/cjs/compat/utils.js +125 -116
- package/dist/cjs/config/default.js +118 -225
- package/dist/cjs/config/index.js +62 -23
- package/dist/cjs/config/initialize/index.js +37 -29
- package/dist/cjs/config/initialize/inits.js +92 -106
- package/dist/cjs/constants.js +37 -37
- package/dist/cjs/defineConfig.js +33 -35
- package/dist/cjs/esm/esbuild-loader.js +62 -0
- package/dist/cjs/esm/esbuild-loader.mjs +11 -23
- package/dist/cjs/esm/register-esm.js +85 -0
- package/dist/cjs/esm/register-esm.mjs +41 -54
- package/dist/cjs/esm/ts-node-loader.js +62 -0
- package/dist/cjs/esm/ts-node-loader.mjs +11 -23
- package/dist/cjs/esm/utils.js +69 -0
- package/dist/cjs/esm/utils.mjs +24 -36
- package/dist/cjs/exports/server.js +16 -26
- package/dist/cjs/index.js +288 -199
- package/dist/cjs/locale/en.js +70 -62
- package/dist/cjs/locale/index.js +42 -33
- package/dist/cjs/locale/zh.js +70 -62
- package/dist/cjs/plugins/analyze/constants.js +43 -36
- package/dist/cjs/plugins/analyze/getBundleEntry.js +90 -94
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +110 -137
- package/dist/cjs/plugins/analyze/getHtmlTemplate.js +125 -127
- package/dist/cjs/plugins/analyze/getServerRoutes.js +160 -164
- package/dist/cjs/plugins/analyze/index.js +221 -208
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +81 -76
- package/dist/cjs/plugins/analyze/templates.js +36 -28
- package/dist/cjs/plugins/analyze/utils.js +109 -104
- package/dist/cjs/plugins/deploy/index.js +64 -56
- package/dist/cjs/plugins/deploy/platforms/gh-pages.js +82 -86
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.js +35 -2
- package/dist/cjs/plugins/deploy/platforms/netlify-handler.js +86 -62
- package/dist/cjs/plugins/deploy/platforms/netlify.js +145 -157
- package/dist/cjs/plugins/deploy/platforms/node-entry.js +73 -45
- package/dist/cjs/plugins/deploy/platforms/node.js +113 -113
- package/dist/cjs/plugins/deploy/platforms/platform.js +17 -15
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.js +36 -2
- package/dist/cjs/plugins/deploy/platforms/vercel-handler.js +87 -63
- package/dist/cjs/plugins/deploy/platforms/vercel.js +165 -169
- package/dist/cjs/plugins/deploy/utils.js +85 -85
- package/dist/cjs/plugins/initialize/index.js +86 -91
- package/dist/cjs/plugins/serverBuild.js +85 -78
- package/dist/cjs/plugins/serverRuntime.js +46 -34
- package/dist/cjs/run/index.js +86 -128
- package/dist/cjs/types/config/deploy.js +17 -15
- package/dist/cjs/types/config/dev.js +17 -15
- package/dist/cjs/types/config/experiments.js +17 -15
- package/dist/cjs/types/config/html.js +17 -15
- package/dist/cjs/types/config/index.js +55 -19
- package/dist/cjs/types/config/output.js +17 -15
- package/dist/cjs/types/config/performance.js +17 -15
- package/dist/cjs/types/config/resolve.js +17 -15
- package/dist/cjs/types/config/security.js +17 -15
- package/dist/cjs/types/config/source.js +17 -15
- package/dist/cjs/types/config/testing.js +17 -15
- package/dist/cjs/types/config/tools.js +17 -15
- package/dist/cjs/types/index.js +55 -23
- package/dist/cjs/types/plugin.js +18 -0
- package/dist/cjs/types/utils.js +17 -15
- package/dist/cjs/utils/config.js +40 -80
- package/dist/cjs/utils/createServer.js +46 -47
- package/dist/cjs/utils/env.js +41 -35
- package/dist/cjs/utils/generateWatchFiles.js +49 -60
- package/dist/cjs/utils/getConfigFile.js +46 -38
- package/dist/cjs/utils/getSelectedEntries.js +55 -53
- package/dist/cjs/utils/initAppContext.js +66 -59
- package/dist/cjs/utils/loadPlugins.js +77 -70
- package/dist/cjs/utils/printInstructions.js +39 -31
- package/dist/cjs/utils/register.js +108 -117
- package/dist/cjs/utils/restart.js +46 -41
- package/dist/cjs/utils/routes.js +60 -52
- package/dist/cjs/utils/types.js +17 -15
- 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 +78 -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/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/createCopyInfo.mjs +15 -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 +37 -0
- package/dist/esm/commands/inspect.mjs +15 -0
- package/dist/esm/commands/serve.mjs +47 -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-node/config/index.js → esm/config/index.mjs} +0 -1
- 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/esbuild-loader.mjs +18 -29
- package/dist/esm/esm/register-esm.mjs +45 -57
- package/dist/esm/esm/ts-node-loader.mjs +18 -30
- package/dist/esm/esm/utils.mjs +31 -42
- package/dist/esm/index.mjs +121 -0
- package/dist/esm/locale/en.mjs +42 -0
- package/dist/esm/locale/index.mjs +9 -0
- package/dist/esm/locale/zh.mjs +42 -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 -1
- package/dist/esm/plugins/deploy/platforms/netlify-handler.mjs +85 -0
- package/dist/esm/plugins/deploy/platforms/netlify.mjs +111 -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 -3
- package/dist/esm/plugins/deploy/platforms/vercel-handler.mjs +85 -0
- package/dist/esm/plugins/deploy/platforms/vercel.mjs +131 -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 +48 -0
- package/dist/esm/plugins/serverRuntime.mjs +15 -0
- package/dist/esm/run/index.mjs +60 -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 +26 -0
- package/dist/esm/utils/loadPlugins.mjs +45 -0
- package/dist/esm/utils/printInstructions.mjs +9 -0
- package/dist/esm/utils/register.mjs +75 -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 +6 -0
- package/dist/esm-node/builder/generator/adapterCopy.mjs +35 -0
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.mjs +59 -0
- package/dist/esm-node/builder/generator/createCopyPattern.mjs +30 -0
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +56 -0
- package/dist/esm-node/builder/generator/index.mjs +45 -0
- package/dist/esm-node/builder/index.mjs +7 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.mjs +78 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +55 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +117 -0
- package/dist/esm-node/builder/shared/builderPlugins/builderHooks.mjs +17 -0
- package/dist/esm-node/builder/shared/builderPlugins/index.mjs +4 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.mjs +37 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.mjs +22 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.mjs +157 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +3 -0
- package/dist/esm-node/builder/shared/createCopyInfo.mjs +15 -0
- package/dist/esm-node/builder/shared/index.mjs +3 -0
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.mjs +5 -0
- package/dist/esm-node/commands/build.mjs +68 -0
- package/dist/esm-node/commands/deploy.mjs +10 -0
- package/dist/esm-node/commands/dev.mjs +82 -0
- package/dist/esm-node/commands/index.mjs +37 -0
- package/dist/esm-node/commands/inspect.mjs +15 -0
- package/dist/esm-node/commands/serve.mjs +47 -0
- package/dist/esm-node/compat/hooks.mjs +67 -0
- package/dist/esm-node/compat/index.mjs +28 -0
- package/dist/esm-node/compat/utils.mjs +95 -0
- package/dist/esm-node/config/default.mjs +90 -0
- package/dist/esm-node/config/index.mjs +2 -0
- package/dist/esm-node/config/initialize/index.mjs +7 -0
- package/dist/esm-node/config/initialize/inits.mjs +54 -0
- package/dist/esm-node/constants.mjs +3 -0
- package/dist/esm-node/defineConfig.mjs +2 -0
- package/dist/esm-node/esm/esbuild-loader.mjs +18 -29
- package/dist/esm-node/esm/register-esm.mjs +45 -57
- package/dist/esm-node/esm/ts-node-loader.mjs +18 -30
- package/dist/esm-node/esm/utils.mjs +31 -42
- package/dist/esm-node/index.mjs +121 -0
- package/dist/esm-node/locale/en.mjs +42 -0
- package/dist/esm-node/locale/index.mjs +9 -0
- package/dist/esm-node/locale/zh.mjs +42 -0
- package/dist/esm-node/plugins/analyze/constants.mjs +8 -0
- package/dist/esm-node/plugins/analyze/getBundleEntry.mjs +53 -0
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.mjs +66 -0
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +85 -0
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +130 -0
- package/dist/esm-node/plugins/analyze/index.mjs +193 -0
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +41 -0
- package/dist/esm-node/plugins/analyze/{templates.js → templates.mjs} +5 -7
- package/dist/esm-node/plugins/analyze/utils.mjs +55 -0
- package/dist/esm-node/plugins/deploy/index.mjs +38 -0
- package/dist/esm-node/plugins/deploy/platforms/gh-pages.mjs +43 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify-entry.mjs +2 -1
- package/dist/esm-node/plugins/deploy/platforms/netlify-handler.mjs +85 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify.mjs +111 -0
- package/dist/esm-node/plugins/deploy/platforms/node-entry.mjs +68 -0
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +77 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel-entry.mjs +3 -3
- package/dist/esm-node/plugins/deploy/platforms/vercel-handler.mjs +85 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel.mjs +131 -0
- package/dist/esm-node/plugins/deploy/utils.mjs +39 -0
- package/dist/esm-node/plugins/initialize/index.mjs +59 -0
- package/dist/esm-node/plugins/serverBuild.mjs +48 -0
- package/dist/esm-node/plugins/serverRuntime.mjs +15 -0
- package/dist/esm-node/run/index.mjs +60 -0
- package/dist/esm-node/types/config/index.mjs +1 -0
- package/dist/esm-node/types/index.mjs +1 -0
- package/dist/esm-node/utils/config.mjs +11 -0
- package/dist/esm-node/utils/createServer.mjs +12 -0
- package/dist/esm-node/utils/env.mjs +12 -0
- package/dist/esm-node/utils/generateWatchFiles.mjs +10 -0
- package/dist/esm-node/utils/getConfigFile.mjs +5 -0
- package/dist/esm-node/utils/getSelectedEntries.mjs +26 -0
- package/dist/esm-node/utils/initAppContext.mjs +26 -0
- package/dist/esm-node/utils/loadPlugins.mjs +45 -0
- package/dist/esm-node/utils/printInstructions.mjs +9 -0
- package/dist/esm-node/utils/register.mjs +75 -0
- package/dist/esm-node/utils/restart.mjs +18 -0
- package/dist/esm-node/utils/routes.mjs +15 -0
- package/dist/types/builder/builder-rspack/index.d.ts +1 -1
- package/dist/types/builder/generator/adapterCopy.d.ts +2 -3
- package/dist/types/builder/generator/createBuilderProviderConfig.d.ts +3 -3
- package/dist/types/builder/generator/createCopyPattern.d.ts +5 -5
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +4 -4
- package/dist/types/builder/generator/index.d.ts +2 -3
- package/dist/types/builder/index.d.ts +2 -2
- package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +1 -2
- package/dist/types/builder/shared/builderPlugins/adapterHtml.d.ts +1 -2
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +1 -2
- package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +1 -2
- package/dist/types/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.d.ts +4 -4
- package/dist/types/builder/shared/bundlerPlugins/HtmlBottomTemplate.d.ts +4 -4
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +3 -5
- package/dist/types/builder/shared/createCopyInfo.d.ts +4 -3
- package/dist/types/builder/shared/loaders/serverModuleLoader.d.ts +2 -2
- package/dist/types/builder/shared/types.d.ts +5 -5
- package/dist/types/commands/build.d.ts +2 -2
- package/dist/types/commands/deploy.d.ts +2 -2
- package/dist/types/commands/dev.d.ts +2 -2
- package/dist/types/commands/index.d.ts +7 -9
- package/dist/types/commands/inspect.d.ts +2 -2
- package/dist/types/commands/serve.d.ts +2 -2
- package/dist/types/compat/hooks.d.ts +2 -2
- package/dist/types/compat/index.d.ts +2 -2
- package/dist/types/config/default.d.ts +3 -4
- package/dist/types/config/index.d.ts +0 -1
- package/dist/types/config/initialize/index.d.ts +2 -2
- package/dist/types/config/initialize/inits.d.ts +3 -4
- package/dist/types/constants.d.ts +0 -3
- package/dist/types/defineConfig.d.ts +7 -8
- package/dist/types/exports/server.d.ts +1 -5
- package/dist/types/index.d.ts +4 -5
- package/dist/types/locale/index.d.ts +1 -1
- package/dist/types/plugins/analyze/constants.d.ts +0 -1
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +2 -2
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/plugins/analyze/getHtmlTemplate.d.ts +4 -4
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +3 -3
- package/dist/types/plugins/analyze/index.d.ts +2 -4
- package/dist/types/plugins/deploy/index.d.ts +2 -2
- package/dist/types/plugins/deploy/platforms/platform.d.ts +2 -2
- package/dist/types/plugins/deploy/utils.d.ts +2 -2
- package/dist/types/plugins/initialize/index.d.ts +2 -4
- package/dist/types/plugins/serverBuild.d.ts +2 -2
- package/dist/types/plugins/serverRuntime.d.ts +2 -2
- package/dist/types/run/index.d.ts +3 -8
- package/dist/types/types/config/deploy.d.ts +0 -1
- package/dist/types/types/config/dev.d.ts +50 -9
- package/dist/types/types/config/experiments.d.ts +2 -2
- package/dist/types/types/config/html.d.ts +2 -2
- package/dist/types/types/config/index.d.ts +10 -14
- package/dist/types/types/config/output.d.ts +8 -8
- package/dist/types/types/config/performance.d.ts +2 -2
- package/dist/types/types/config/resolve.d.ts +2 -2
- package/dist/types/types/config/security.d.ts +2 -2
- package/dist/types/types/config/source.d.ts +2 -23
- package/dist/types/types/config/tools.d.ts +5 -22
- package/dist/types/types/index.d.ts +7 -34
- package/dist/types/types/{new.d.ts → plugin.d.ts} +10 -39
- package/dist/types/types/utils.d.ts +0 -6
- package/dist/types/utils/config.d.ts +1 -11
- package/dist/types/utils/createServer.d.ts +1 -3
- package/dist/types/utils/env.d.ts +2 -2
- package/dist/types/utils/generateWatchFiles.d.ts +2 -3
- package/dist/types/utils/initAppContext.d.ts +1 -3
- package/dist/types/utils/loadPlugins.d.ts +5 -5
- package/dist/types/utils/printInstructions.d.ts +2 -2
- package/dist/types/utils/restart.d.ts +2 -2
- package/dist/types/utils/routes.d.ts +2 -3
- package/lib/types.d.ts +5 -16
- package/package.json +51 -38
- package/rslib.config.mts +20 -0
- package/dist/cjs/builder/builder-webpack/index.js +0 -50
- package/dist/cjs/config/legacy/createHtmlConfig.js +0 -45
- package/dist/cjs/config/legacy/createOutputConfig.js +0 -69
- package/dist/cjs/config/legacy/createSourceConfig.js +0 -53
- package/dist/cjs/config/legacy/createToolsConfig.js +0 -52
- package/dist/cjs/config/legacy/index.js +0 -68
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.mjs +0 -1
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.mjs +0 -3
- package/dist/cjs/types/hooks.js +0 -16
- package/dist/cjs/types/legacyConfig/deploy.js +0 -16
- package/dist/cjs/types/legacyConfig/dev.js +0 -16
- package/dist/cjs/types/legacyConfig/index.js +0 -16
- package/dist/cjs/types/legacyConfig/output.js +0 -16
- package/dist/cjs/types/legacyConfig/source.js +0 -16
- package/dist/cjs/types/legacyConfig/testing.js +0 -16
- package/dist/cjs/types/legacyConfig/tools.js +0 -16
- package/dist/cjs/types/new.js +0 -16
- package/dist/cjs/utils/getUserConfig.js +0 -34
- package/dist/esm/builder/builder-rspack/index.js +0 -30
- package/dist/esm/builder/builder-webpack/index.js +0 -48
- package/dist/esm/builder/generator/adapterCopy.js +0 -29
- package/dist/esm/builder/generator/createBuilderProviderConfig.js +0 -56
- package/dist/esm/builder/generator/createCopyPattern.js +0 -43
- package/dist/esm/builder/generator/getBuilderEnvironments.js +0 -89
- package/dist/esm/builder/generator/index.js +0 -116
- package/dist/esm/builder/index.js +0 -50
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.js +0 -92
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +0 -126
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +0 -262
- package/dist/esm/builder/shared/builderPlugins/builderHooks.js +0 -120
- package/dist/esm/builder/shared/builderPlugins/index.js +0 -4
- package/dist/esm/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -51
- package/dist/esm/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -37
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.js +0 -420
- package/dist/esm/builder/shared/bundlerPlugins/index.js +0 -3
- package/dist/esm/builder/shared/createCopyInfo.js +0 -14
- package/dist/esm/builder/shared/index.js +0 -3
- package/dist/esm/builder/shared/loaders/serverModuleLoader.js +0 -7
- package/dist/esm/commands/build.js +0 -142
- package/dist/esm/commands/deploy.js +0 -48
- package/dist/esm/commands/dev.js +0 -197
- package/dist/esm/commands/index.js +0 -401
- package/dist/esm/commands/inspect.js +0 -31
- package/dist/esm/commands/serve.js +0 -96
- package/dist/esm/compat/hooks.js +0 -503
- package/dist/esm/compat/index.js +0 -45
- package/dist/esm/compat/utils.js +0 -100
- package/dist/esm/config/default.js +0 -205
- package/dist/esm/config/index.js +0 -3
- package/dist/esm/config/initialize/index.js +0 -9
- package/dist/esm/config/initialize/inits.js +0 -89
- package/dist/esm/config/legacy/createHtmlConfig.js +0 -21
- package/dist/esm/config/legacy/createOutputConfig.js +0 -45
- package/dist/esm/config/legacy/createSourceConfig.js +0 -46
- package/dist/esm/config/legacy/createToolsConfig.js +0 -28
- package/dist/esm/config/legacy/index.js +0 -43
- package/dist/esm/constants.js +0 -12
- package/dist/esm/defineConfig.js +0 -16
- package/dist/esm/exports/server.js +0 -4
- package/dist/esm/index.js +0 -265
- package/dist/esm/locale/en.js +0 -44
- package/dist/esm/locale/index.js +0 -12
- package/dist/esm/locale/zh.js +0 -44
- package/dist/esm/plugins/analyze/constants.js +0 -14
- package/dist/esm/plugins/analyze/getBundleEntry.js +0 -108
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +0 -268
- package/dist/esm/plugins/analyze/getHtmlTemplate.js +0 -251
- package/dist/esm/plugins/analyze/getServerRoutes.js +0 -148
- package/dist/esm/plugins/analyze/index.js +0 -439
- package/dist/esm/plugins/analyze/isDefaultExportFunction.js +0 -49
- package/dist/esm/plugins/analyze/templates.js +0 -6
- package/dist/esm/plugins/analyze/utils.js +0 -106
- package/dist/esm/plugins/deploy/index.js +0 -133
- package/dist/esm/plugins/deploy/platforms/gh-pages.js +0 -184
- package/dist/esm/plugins/deploy/platforms/netlify-entry.js +0 -11
- package/dist/esm/plugins/deploy/platforms/netlify-handler.js +0 -207
- package/dist/esm/plugins/deploy/platforms/netlify.js +0 -346
- package/dist/esm/plugins/deploy/platforms/node-entry.js +0 -110
- package/dist/esm/plugins/deploy/platforms/node.js +0 -178
- package/dist/esm/plugins/deploy/platforms/vercel-entry.js +0 -11
- package/dist/esm/plugins/deploy/platforms/vercel-handler.js +0 -207
- package/dist/esm/plugins/deploy/platforms/vercel.js +0 -280
- package/dist/esm/plugins/deploy/utils.js +0 -59
- package/dist/esm/plugins/initialize/index.js +0 -116
- package/dist/esm/plugins/serverBuild.js +0 -83
- package/dist/esm/plugins/serverRuntime.js +0 -22
- package/dist/esm/run/index.js +0 -134
- package/dist/esm/types/config/index.js +0 -1
- package/dist/esm/types/config/source.js +0 -0
- package/dist/esm/types/config/testing.js +0 -0
- package/dist/esm/types/config/tools.js +0 -0
- package/dist/esm/types/hooks.js +0 -0
- package/dist/esm/types/index.js +0 -3
- package/dist/esm/types/legacyConfig/deploy.js +0 -0
- package/dist/esm/types/legacyConfig/dev.js +0 -0
- package/dist/esm/types/legacyConfig/index.js +0 -0
- package/dist/esm/types/legacyConfig/output.js +0 -0
- package/dist/esm/types/legacyConfig/source.js +0 -0
- package/dist/esm/types/legacyConfig/testing.js +0 -0
- package/dist/esm/types/legacyConfig/tools.js +0 -0
- package/dist/esm/types/new.js +0 -0
- package/dist/esm/types/utils.js +0 -0
- package/dist/esm/utils/config.js +0 -122
- package/dist/esm/utils/createServer.js +0 -58
- package/dist/esm/utils/env.js +0 -16
- package/dist/esm/utils/generateWatchFiles.js +0 -71
- package/dist/esm/utils/getConfigFile.js +0 -11
- package/dist/esm/utils/getSelectedEntries.js +0 -67
- package/dist/esm/utils/getUserConfig.js +0 -32
- package/dist/esm/utils/initAppContext.js +0 -30
- package/dist/esm/utils/loadPlugins.js +0 -162
- package/dist/esm/utils/printInstructions.js +0 -32
- package/dist/esm/utils/register.js +0 -182
- package/dist/esm/utils/restart.js +0 -68
- package/dist/esm/utils/routes.js +0 -42
- package/dist/esm/utils/types.js +0 -0
- package/dist/esm-node/builder/builder-rspack/index.js +0 -8
- package/dist/esm-node/builder/builder-webpack/index.js +0 -16
- package/dist/esm-node/builder/generator/adapterCopy.js +0 -26
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.js +0 -67
- package/dist/esm-node/builder/generator/createCopyPattern.js +0 -41
- package/dist/esm-node/builder/generator/getBuilderEnvironments.js +0 -68
- package/dist/esm-node/builder/generator/index.js +0 -60
- package/dist/esm-node/builder/index.js +0 -16
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.js +0 -55
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +0 -60
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +0 -151
- package/dist/esm-node/builder/shared/builderPlugins/builderHooks.js +0 -26
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -30
- package/dist/esm-node/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -31
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.js +0 -305
- package/dist/esm-node/builder/shared/createCopyInfo.js +0 -14
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.js +0 -7
- package/dist/esm-node/commands/build.js +0 -67
- package/dist/esm-node/commands/deploy.js +0 -12
- package/dist/esm-node/commands/dev.js +0 -111
- package/dist/esm-node/commands/index.js +0 -90
- package/dist/esm-node/commands/inspect.js +0 -19
- package/dist/esm-node/commands/serve.js +0 -54
- package/dist/esm-node/compat/hooks.js +0 -159
- package/dist/esm-node/compat/index.js +0 -40
- package/dist/esm-node/compat/utils.js +0 -100
- package/dist/esm-node/config/default.js +0 -206
- package/dist/esm-node/config/initialize/index.js +0 -9
- package/dist/esm-node/config/initialize/inits.js +0 -79
- package/dist/esm-node/config/legacy/createHtmlConfig.js +0 -21
- package/dist/esm-node/config/legacy/createOutputConfig.js +0 -45
- package/dist/esm-node/config/legacy/createSourceConfig.js +0 -29
- package/dist/esm-node/config/legacy/createToolsConfig.js +0 -28
- package/dist/esm-node/config/legacy/index.js +0 -43
- package/dist/esm-node/constants.js +0 -12
- package/dist/esm-node/defineConfig.js +0 -13
- package/dist/esm-node/exports/server.js +0 -4
- package/dist/esm-node/index.js +0 -160
- package/dist/esm-node/locale/en.js +0 -44
- package/dist/esm-node/locale/index.js +0 -12
- package/dist/esm-node/locale/zh.js +0 -44
- package/dist/esm-node/plugins/analyze/constants.js +0 -14
- package/dist/esm-node/plugins/analyze/getBundleEntry.js +0 -67
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +0 -108
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.js +0 -99
- package/dist/esm-node/plugins/analyze/getServerRoutes.js +0 -146
- package/dist/esm-node/plugins/analyze/index.js +0 -184
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.js +0 -47
- package/dist/esm-node/plugins/analyze/utils.js +0 -73
- package/dist/esm-node/plugins/deploy/index.js +0 -44
- package/dist/esm-node/plugins/deploy/platforms/gh-pages.js +0 -57
- package/dist/esm-node/plugins/deploy/platforms/netlify-entry.js +0 -11
- package/dist/esm-node/plugins/deploy/platforms/netlify-handler.js +0 -73
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +0 -133
- package/dist/esm-node/plugins/deploy/platforms/node-entry.js +0 -46
- package/dist/esm-node/plugins/deploy/platforms/node.js +0 -87
- package/dist/esm-node/plugins/deploy/platforms/vercel-entry.js +0 -11
- package/dist/esm-node/plugins/deploy/platforms/vercel-handler.js +0 -73
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +0 -145
- package/dist/esm-node/plugins/deploy/utils.js +0 -55
- package/dist/esm-node/plugins/initialize/index.js +0 -78
- package/dist/esm-node/plugins/serverBuild.js +0 -56
- package/dist/esm-node/plugins/serverRuntime.js +0 -17
- package/dist/esm-node/run/index.js +0 -104
- package/dist/esm-node/types/index.js +0 -3
- package/dist/esm-node/utils/config.js +0 -49
- package/dist/esm-node/utils/createServer.js +0 -26
- package/dist/esm-node/utils/env.js +0 -16
- package/dist/esm-node/utils/generateWatchFiles.js +0 -30
- package/dist/esm-node/utils/getConfigFile.js +0 -7
- package/dist/esm-node/utils/getSelectedEntries.js +0 -34
- package/dist/esm-node/utils/getUserConfig.js +0 -10
- package/dist/esm-node/utils/initAppContext.js +0 -29
- package/dist/esm-node/utils/loadPlugins.js +0 -52
- package/dist/esm-node/utils/printInstructions.js +0 -11
- package/dist/esm-node/utils/register.js +0 -94
- package/dist/esm-node/utils/restart.js +0 -23
- package/dist/esm-node/utils/routes.js +0 -21
- package/dist/types/builder/builder-webpack/index.d.ts +0 -2
- 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/types/hooks.d.ts +0 -69
- package/dist/types/types/legacyConfig/deploy.d.ts +0 -8
- package/dist/types/types/legacyConfig/dev.d.ts +0 -12
- package/dist/types/types/legacyConfig/index.d.ts +0 -35
- package/dist/types/types/legacyConfig/output.d.ts +0 -50
- package/dist/types/types/legacyConfig/source.d.ts +0 -28
- package/dist/types/types/legacyConfig/testing.d.ts +0 -8
- package/dist/types/types/legacyConfig/tools.d.ts +0 -15
- package/dist/types/utils/getUserConfig.d.ts +0 -6
- /package/dist/{esm-node/builder/shared/builderPlugins/index.js → esm/builder/shared/builderPlugins/index.mjs} +0 -0
- /package/dist/{esm-node/builder/shared/bundlerPlugins/index.js → esm/builder/shared/bundlerPlugins/index.mjs} +0 -0
- /package/dist/{esm-node/builder/shared/index.js → esm/builder/shared/index.mjs} +0 -0
- /package/dist/{esm-node/types/legacyConfig/output.js → esm/builder/shared/types.mjs} +0 -0
- /package/dist/{esm-node/types/legacyConfig/source.js → esm/exports/server.mjs} +0 -0
- /package/dist/{esm-node/types/legacyConfig/testing.js → esm/plugins/deploy/platforms/platform.mjs} +0 -0
- /package/dist/{esm-node/types/legacyConfig/tools.js → esm/types/config/deploy.mjs} +0 -0
- /package/dist/{esm-node/types/new.js → esm/types/config/dev.mjs} +0 -0
- /package/dist/{esm-node/types/utils.js → esm/types/config/experiments.mjs} +0 -0
- /package/dist/{esm-node/utils/types.js → esm/types/config/html.mjs} +0 -0
- /package/dist/{esm-node/types/config/index.js → esm/types/config/index.mjs} +0 -0
- /package/dist/esm/{builder/shared/types.js → types/config/output.mjs} +0 -0
- /package/dist/esm/{plugins/deploy/platforms/platform.js → types/config/performance.mjs} +0 -0
- /package/dist/esm/types/config/{deploy.js → resolve.mjs} +0 -0
- /package/dist/esm/types/config/{dev.js → security.mjs} +0 -0
- /package/dist/esm/types/config/{experiments.js → source.mjs} +0 -0
- /package/dist/esm/types/config/{html.js → testing.mjs} +0 -0
- /package/dist/esm/types/config/{output.js → tools.mjs} +0 -0
- /package/dist/esm/types/{config/performance.js → plugin.mjs} +0 -0
- /package/dist/esm/types/{config/resolve.js → utils.mjs} +0 -0
- /package/dist/esm/{types/config/security.js → utils/types.mjs} +0 -0
- /package/dist/esm-node/builder/shared/{types.js → types.mjs} +0 -0
- /package/dist/esm-node/{plugins/deploy/platforms/platform.js → exports/server.mjs} +0 -0
- /package/dist/esm-node/{types/config/deploy.js → plugins/deploy/platforms/platform.mjs} +0 -0
- /package/dist/esm-node/types/config/{dev.js → deploy.mjs} +0 -0
- /package/dist/esm-node/types/config/{experiments.js → dev.mjs} +0 -0
- /package/dist/esm-node/types/config/{html.js → experiments.mjs} +0 -0
- /package/dist/esm-node/types/config/{output.js → html.mjs} +0 -0
- /package/dist/esm-node/types/config/{performance.js → output.mjs} +0 -0
- /package/dist/esm-node/types/config/{resolve.js → performance.mjs} +0 -0
- /package/dist/esm-node/types/config/{security.js → resolve.mjs} +0 -0
- /package/dist/esm-node/types/config/{source.js → security.mjs} +0 -0
- /package/dist/esm-node/types/config/{testing.js → source.mjs} +0 -0
- /package/dist/esm-node/types/config/{tools.js → testing.mjs} +0 -0
- /package/dist/esm-node/types/{hooks.js → config/tools.mjs} +0 -0
- /package/dist/esm-node/types/{legacyConfig/deploy.js → plugin.mjs} +0 -0
- /package/dist/esm-node/types/{legacyConfig/dev.js → utils.mjs} +0 -0
- /package/dist/esm-node/{types/legacyConfig/index.js → utils/types.mjs} +0 -0
|
@@ -1,37 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
|
4
|
-
import type { AppToolsHooks } from './hooks';
|
|
5
|
-
import type { AppToolsLegacyNormalizedConfig, AppToolsLegacyUserConfig } from './legacyConfig';
|
|
6
|
-
import type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks } from './new';
|
|
7
|
-
import type { Bundler } from './utils';
|
|
1
|
+
import type { CLIPluginAPI, CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig } from '@modern-js/plugin';
|
|
2
|
+
import type { AppTools, AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
|
8
3
|
export type { CLIPluginExtends, RuntimePluginConfig, ServerPluginConfig };
|
|
9
|
-
export * from './hooks';
|
|
10
4
|
export * from './config';
|
|
11
|
-
export
|
|
12
|
-
export type { webpack, Rspack } from '@modern-js/uni-builder';
|
|
13
|
-
export type { Bundler } from './utils';
|
|
5
|
+
export type { Rspack } from '@modern-js/builder';
|
|
14
6
|
export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries, Resource, Params, RequestHandlerConfig, LoaderContext, OnError, OnTiming, RequestHandlerOptions, RequestHandler, } from '@modern-js/server-core';
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
export type LegacyAppTools = {
|
|
21
|
-
hooks: AppToolsHooks;
|
|
22
|
-
userConfig: AppToolsLegacyUserConfig;
|
|
23
|
-
normalizedConfig: AppToolsLegacyNormalizedConfig;
|
|
24
|
-
};
|
|
25
|
-
export type CliPluginFuture<Extends extends CLIPluginExtends> = CLIPlugin<Extends>;
|
|
26
|
-
export type AppNormalizedConfig<B extends Bundler = 'webpack'> = NormalizedConfig<AppTools<B>>;
|
|
27
|
-
export type AppLegacyNormalizedConfig = NormalizedConfig<LegacyAppTools>;
|
|
28
|
-
export type AppUserConfig<B extends Bundler = 'webpack'> = UserConfig<AppTools<B>>;
|
|
29
|
-
export type AppLegacyUserConfig = UserConfig<LegacyAppTools>;
|
|
30
|
-
export type AppToolsOptions = {
|
|
31
|
-
/**
|
|
32
|
-
* Specify which bundler to use for the build.
|
|
33
|
-
* @default `webpack`
|
|
34
|
-
* */
|
|
35
|
-
bundler?: 'rspack' | 'webpack' | 'experimental-rspack';
|
|
36
|
-
};
|
|
37
|
-
export type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks, AppToolsContext, AppToolsHooks as AppToolsFeatureHooks, } from './new';
|
|
7
|
+
export type AppUserConfig = AppToolsUserConfig;
|
|
8
|
+
export type AppNormalizedConfig = AppToolsNormalizedConfig;
|
|
9
|
+
export type AppToolsAPI = CLIPluginAPI<AppTools>;
|
|
10
|
+
export type { AppToolsExtendAPI, AppToolsExtendContext, AppToolsExtendHooks, AppToolsContext, AppToolsHooks as AppToolsFeatureHooks, } from './plugin';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { Hooks } from '@modern-js/plugin-v2/cli';
|
|
1
|
+
import type { AppContext, AsyncHook, InternalContext, PluginHook, PluginHookTap, TransformFunction } from '@modern-js/plugin';
|
|
2
|
+
import type { Hooks } from '@modern-js/plugin/cli';
|
|
4
3
|
import type { Entrypoint, HtmlPartials, HtmlTemplates, NestedRouteForCli, PageRoute, RouteLegacy, ServerPlugin, ServerRoute } from '@modern-js/types';
|
|
5
4
|
import type { AppTools } from '.';
|
|
6
5
|
import type { getHookRunners } from '../compat/hooks';
|
|
7
6
|
import type { AppToolsNormalizedConfig, AppToolsUserConfig } from './config';
|
|
8
|
-
import type { Bundler } from './utils';
|
|
9
7
|
export type AfterPrepareFn = () => Promise<void> | void;
|
|
10
8
|
export type CheckEntryPointFn = TransformFunction<{
|
|
11
9
|
path: string;
|
|
@@ -29,10 +27,8 @@ export type BeforeGenerateRoutesFn = TransformFunction<{
|
|
|
29
27
|
export type BeforePrintInstructionsFn = TransformFunction<{
|
|
30
28
|
instructions: string;
|
|
31
29
|
}>;
|
|
32
|
-
export type RegisterDevFn = () => Promise<DevToolData> | DevToolData;
|
|
33
|
-
export type RegisterBuildPlatformFn = () => Promise<RegisterBuildPlatformResult> | RegisterBuildPlatformResult;
|
|
34
30
|
export type AddRuntimeExportsFn = () => Promise<void> | void;
|
|
35
|
-
export interface AppToolsExtendAPI
|
|
31
|
+
export interface AppToolsExtendAPI {
|
|
36
32
|
onAfterPrepare: PluginHookTap<AfterPrepareFn>;
|
|
37
33
|
deploy: PluginHookTap<DeplpoyFn>;
|
|
38
34
|
checkEntryPoint: PluginHookTap<CheckEntryPointFn>;
|
|
@@ -44,30 +40,18 @@ export interface AppToolsExtendAPI<B extends Bundler = 'webpack'> {
|
|
|
44
40
|
* @deprecated
|
|
45
41
|
*/
|
|
46
42
|
onBeforePrintInstructions: PluginHookTap<BeforePrintInstructionsFn>;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated
|
|
49
|
-
*/
|
|
50
|
-
registerDev: PluginHookTap<RegisterDevFn>;
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated
|
|
53
|
-
*/
|
|
54
|
-
registerBuildPlatform: PluginHookTap<RegisterBuildPlatformFn>;
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated
|
|
57
|
-
*/
|
|
58
|
-
addRuntimeExports: PluginHookTap<AddRuntimeExportsFn>;
|
|
59
43
|
/**
|
|
60
44
|
* @deprecated use getAppContext instead
|
|
61
45
|
*/
|
|
62
|
-
useAppContext: () => AppToolsContext
|
|
46
|
+
useAppContext: () => AppToolsContext;
|
|
63
47
|
/**
|
|
64
48
|
* @deprecated use getConfig instead
|
|
65
49
|
*/
|
|
66
|
-
useConfigContext: () => AppToolsUserConfig
|
|
50
|
+
useConfigContext: () => AppToolsUserConfig;
|
|
67
51
|
/**
|
|
68
52
|
* @deprecated use getNormalizedConfig instead
|
|
69
53
|
*/
|
|
70
|
-
useResolvedConfigContext: () => AppToolsNormalizedConfig<AppToolsUserConfig
|
|
54
|
+
useResolvedConfigContext: () => AppToolsNormalizedConfig<AppToolsUserConfig>;
|
|
71
55
|
/**
|
|
72
56
|
* @deprecated use api.xx instead
|
|
73
57
|
*/
|
|
@@ -85,20 +69,8 @@ export interface AppToolsExtendHooks extends Record<string, PluginHook<(...args:
|
|
|
85
69
|
* @deprecated
|
|
86
70
|
*/
|
|
87
71
|
onBeforePrintInstructions: AsyncHook<BeforePrintInstructionsFn>;
|
|
88
|
-
/**
|
|
89
|
-
* @deprecated
|
|
90
|
-
*/
|
|
91
|
-
registerDev: CollectAsyncHook<RegisterDevFn>;
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated
|
|
94
|
-
*/
|
|
95
|
-
registerBuildPlatform: CollectAsyncHook<RegisterBuildPlatformFn>;
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated
|
|
98
|
-
*/
|
|
99
|
-
addRuntimeExports: AsyncHook<AddRuntimeExportsFn>;
|
|
100
72
|
}
|
|
101
|
-
export interface AppToolsExtendContext
|
|
73
|
+
export interface AppToolsExtendContext {
|
|
102
74
|
metaName: string;
|
|
103
75
|
internalDirectory: string;
|
|
104
76
|
sharedDirectory: string;
|
|
@@ -106,7 +78,6 @@ export interface AppToolsExtendContext<B extends Bundler = 'webpack'> {
|
|
|
106
78
|
internalSrcAlias: string;
|
|
107
79
|
apiDirectory: string;
|
|
108
80
|
lambdaDirectory: string;
|
|
109
|
-
serverConfigFile: string;
|
|
110
81
|
runtimeConfigFile: string;
|
|
111
82
|
serverPlugins: ServerPlugin[];
|
|
112
83
|
moduleType: 'module' | 'commonjs';
|
|
@@ -118,7 +89,7 @@ export interface AppToolsExtendContext<B extends Bundler = 'webpack'> {
|
|
|
118
89
|
serverRoutes: ServerRoute[];
|
|
119
90
|
/** Whether to use api only mode */
|
|
120
91
|
apiOnly: boolean;
|
|
121
|
-
_internalContext: InternalContext<AppTools
|
|
92
|
+
_internalContext: InternalContext<AppTools>;
|
|
122
93
|
/**
|
|
123
94
|
* Information for HTML templates by entry
|
|
124
95
|
* @private
|
|
@@ -139,5 +110,5 @@ export interface AppToolsExtendContext<B extends Bundler = 'webpack'> {
|
|
|
139
110
|
*/
|
|
140
111
|
bffRuntimeFramework?: string;
|
|
141
112
|
}
|
|
142
|
-
export type AppToolsContext
|
|
143
|
-
export type AppToolsHooks
|
|
113
|
+
export type AppToolsContext = AppContext<AppTools> & AppToolsExtendContext;
|
|
114
|
+
export type AppToolsHooks = Hooks<AppToolsUserConfig, AppToolsNormalizedConfig, {}, {}> & AppToolsExtendHooks;
|
|
@@ -1,7 +1 @@
|
|
|
1
1
|
export type UnwrapBuilderConfig<Config, Key extends keyof Config> = Required<Config>[Key];
|
|
2
|
-
export type Bundler = 'rspack' | 'webpack' | 'shared';
|
|
3
|
-
export type FromConfig<B extends Bundler, Config extends {
|
|
4
|
-
rspack: Rspack;
|
|
5
|
-
webpack: Webpack;
|
|
6
|
-
shared: Shared;
|
|
7
|
-
}, Rspack = {}, Webpack = {}, Shared = {}> = B extends 'shared' ? Config['shared'] : B extends 'rspack' ? Config['rspack'] : Config['webpack'];
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import { bundle } from '@modern-js/node-bundle-require';
|
|
2
|
-
import type { ServerConfig } from '@modern-js/server-core';
|
|
3
1
|
import type { AppNormalizedConfig } from '../types';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const buildServerConfig: ({ appDirectory, distDirectory, configFile, options, watch, }: {
|
|
6
|
-
appDirectory: string;
|
|
7
|
-
distDirectory: string;
|
|
8
|
-
configFile: string;
|
|
9
|
-
options?: Parameters<typeof bundle>[1];
|
|
10
|
-
watch?: boolean;
|
|
11
|
-
}) => Promise<void>;
|
|
12
|
-
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig<"shared">) => Promise<void>;
|
|
2
|
+
export declare const emitResolvedConfig: (appDirectory: string, resolvedConfig: AppNormalizedConfig) => Promise<void>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { Http2SecureServer } from 'node:http2';
|
|
3
|
-
import
|
|
4
|
-
export declare const getServer: () => Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | Http2SecureServer | null;
|
|
3
|
+
export declare const getServer: () => Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | Http2SecureServer<typeof import("http").IncomingMessage, typeof import("http").ServerResponse, typeof import("http2").Http2ServerRequest, typeof import("http2").Http2ServerResponse> | null;
|
|
5
4
|
export declare const setServer: (newServer: Server | Http2SecureServer) => void;
|
|
6
5
|
export declare const closeServer: () => Promise<void>;
|
|
7
|
-
export declare const createServer: (options: ModernDevServerOptions) => Promise<Server | Http2SecureServer>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AppToolsContext } from '../types/
|
|
2
|
-
export declare function getAutoInjectEnv(appContext: AppToolsContext
|
|
1
|
+
import type { AppToolsContext } from '../types/plugin';
|
|
2
|
+
export declare function getAutoInjectEnv(appContext: AppToolsContext): Record<string, string>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { AppToolsContext } from '../types/
|
|
2
|
-
export declare
|
|
3
|
-
export declare function generateWatchFiles(appContext: AppToolsContext<'shared'>, configDir?: string): Promise<string[]>;
|
|
1
|
+
import type { AppToolsContext } from '../types/plugin';
|
|
2
|
+
export declare function generateWatchFiles(appContext: AppToolsContext, configDir?: string): Promise<string[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const initAppContext: ({ metaName, appDirectory, runtimeConfigFile, options,
|
|
1
|
+
export declare const initAppContext: ({ metaName, appDirectory, runtimeConfigFile, options, tempDir, }: {
|
|
2
2
|
metaName: string;
|
|
3
3
|
appDirectory: string;
|
|
4
4
|
runtimeConfigFile: string;
|
|
@@ -8,11 +8,9 @@ export declare const initAppContext: ({ metaName, appDirectory, runtimeConfigFil
|
|
|
8
8
|
distDir?: string;
|
|
9
9
|
sharedDir?: string;
|
|
10
10
|
};
|
|
11
|
-
serverConfigFile: string;
|
|
12
11
|
tempDir?: string;
|
|
13
12
|
}) => {
|
|
14
13
|
runtimeConfigFile: string;
|
|
15
|
-
serverConfigFile: string;
|
|
16
14
|
ip: any;
|
|
17
15
|
port: number;
|
|
18
16
|
moduleType: any;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CLIPluginAPI } from '@modern-js/plugin
|
|
2
|
-
import type { Plugin } from '@modern-js/plugin
|
|
1
|
+
import type { CLIPluginAPI } from '@modern-js/plugin';
|
|
2
|
+
import type { Plugin } from '@modern-js/plugin';
|
|
3
3
|
import type { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
|
|
4
4
|
import type { ServerPlugin } from '@modern-js/types';
|
|
5
5
|
import type { InternalPlugins } from '@modern-js/types';
|
|
6
6
|
import type { AppTools } from '../types';
|
|
7
|
-
export declare function getServerPlugins(api: CLIPluginAPI<AppTools
|
|
8
|
-
export declare function loadServerPlugins(api: CLIPluginAPI<AppTools
|
|
7
|
+
export declare function getServerPlugins(api: CLIPluginAPI<AppTools>, metaName?: string): Promise<ServerPlugin[]>;
|
|
8
|
+
export declare function loadServerPlugins(api: CLIPluginAPI<AppTools>, appDirectory: string, metaName: string): Promise<ServerPluginInstance[]>;
|
|
9
9
|
/**
|
|
10
10
|
* Load internal plugins which in @modern-js scope and user's custom plugins.
|
|
11
11
|
* @param appDirectory - Application root directory.
|
|
12
12
|
* @param internalPlugins - Internal plugins.
|
|
13
13
|
* @returns Plugin Objects has been required.
|
|
14
14
|
*/
|
|
15
|
-
export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins
|
|
15
|
+
export declare const loadInternalPlugins: (appDirectory: string, internalPlugins?: InternalPlugins) => Promise<Plugin[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AppNormalizedConfig } from '../types';
|
|
2
|
-
import type { AppToolsContext, AppToolsHooks } from '../types/
|
|
3
|
-
export declare const printInstructions: (hooks: AppToolsHooks
|
|
2
|
+
import type { AppToolsContext, AppToolsHooks } from '../types/plugin';
|
|
3
|
+
export declare const printInstructions: (hooks: AppToolsHooks, appContext: AppToolsContext, config: AppNormalizedConfig) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AppToolsHooks } from '../types/
|
|
2
|
-
export declare function restart(hooks: AppToolsHooks
|
|
1
|
+
import type { AppToolsHooks } from '../types/plugin';
|
|
2
|
+
export declare function restart(hooks: AppToolsHooks, filename: string): Promise<void>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare const generateRoutes: (appContext: AppToolsContext<"shared"> | IAppContext) => Promise<void>;
|
|
1
|
+
import type { AppToolsContext } from '../types/plugin';
|
|
2
|
+
export declare const generateRoutes: (appContext: AppToolsContext) => Promise<void>;
|
|
4
3
|
export declare const getPathWithoutExt: (filename: string) => string;
|
|
5
4
|
export declare const isMainEntry: (entryName: string, mainEntryName?: string) => boolean;
|
package/lib/types.d.ts
CHANGED
|
@@ -239,24 +239,13 @@ declare module '*.hbs' {
|
|
|
239
239
|
export default src;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
declare module '*.yaml' {
|
|
243
|
-
const src: Record<string, any>;
|
|
244
|
-
export default src;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
declare module '*.yml' {
|
|
248
|
-
const content: Record<string, any>;
|
|
249
|
-
export default content;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
declare module '*.toml' {
|
|
253
|
-
const src: Record<string, any>;
|
|
254
|
-
export default src;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
242
|
declare module '*.xml' {
|
|
258
243
|
const src: string;
|
|
259
244
|
export default src;
|
|
260
245
|
}
|
|
261
246
|
|
|
262
|
-
declare module '
|
|
247
|
+
declare module 'http' {
|
|
248
|
+
interface ServerResponse {
|
|
249
|
+
locals: Record<string, any>;
|
|
250
|
+
}
|
|
251
|
+
}
|
package/package.json
CHANGED
|
@@ -15,16 +15,17 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "
|
|
18
|
+
"version": "3.0.0-alpha.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
22
|
+
"module": "./dist/esm-node/index.mjs",
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
25
|
"types": "./dist/types/index.d.ts",
|
|
26
|
+
"jsnext:source": "./src/index.ts",
|
|
25
27
|
"node": {
|
|
26
|
-
"
|
|
27
|
-
"import": "./dist/esm/index.js",
|
|
28
|
+
"import": "./dist/esm-node/index.mjs",
|
|
28
29
|
"require": "./dist/cjs/index.js"
|
|
29
30
|
},
|
|
30
31
|
"default": "./dist/cjs/index.js"
|
|
@@ -32,16 +33,28 @@
|
|
|
32
33
|
"./builder": {
|
|
33
34
|
"types": "./dist/types/builder/index.d.ts",
|
|
34
35
|
"jsnext:source": "./src/builder/index.ts",
|
|
36
|
+
"node": {
|
|
37
|
+
"import": "./dist/esm-node/builder/index.mjs",
|
|
38
|
+
"require": "./dist/cjs/builder/index.js"
|
|
39
|
+
},
|
|
35
40
|
"default": "./dist/cjs/builder/index.js"
|
|
36
41
|
},
|
|
37
42
|
"./cli": {
|
|
38
43
|
"types": "./dist/types/index.d.ts",
|
|
39
44
|
"jsnext:source": "./src/index.ts",
|
|
45
|
+
"node": {
|
|
46
|
+
"import": "./dist/esm-node/index.mjs",
|
|
47
|
+
"require": "./dist/cjs/index.js"
|
|
48
|
+
},
|
|
40
49
|
"default": "./dist/cjs/index.js"
|
|
41
50
|
},
|
|
42
51
|
"./cli/run": {
|
|
43
52
|
"types": "./dist/types/run/index.d.ts",
|
|
44
53
|
"jsnext:source": "./src/run/index.ts",
|
|
54
|
+
"node": {
|
|
55
|
+
"import": "./dist/esm-node/run/index.mjs",
|
|
56
|
+
"require": "./dist/cjs/run/index.js"
|
|
57
|
+
},
|
|
45
58
|
"default": "./dist/cjs/run/index.js"
|
|
46
59
|
},
|
|
47
60
|
"./types": {
|
|
@@ -52,11 +65,15 @@
|
|
|
52
65
|
"./server": {
|
|
53
66
|
"types": "./dist/types/exports/server.d.ts",
|
|
54
67
|
"jsnext:source": "./src/exports/server.ts",
|
|
68
|
+
"node": {
|
|
69
|
+
"import": "./dist/esm-node/exports/server.mjs",
|
|
70
|
+
"require": "./dist/cjs/exports/server.js"
|
|
71
|
+
},
|
|
55
72
|
"default": "./dist/cjs/exports/server.js"
|
|
56
73
|
}
|
|
57
74
|
},
|
|
58
75
|
"engines": {
|
|
59
|
-
"node": ">=
|
|
76
|
+
"node": ">=20"
|
|
60
77
|
},
|
|
61
78
|
"typesVersions": {
|
|
62
79
|
"*": {
|
|
@@ -74,6 +91,9 @@
|
|
|
74
91
|
],
|
|
75
92
|
"deploy": [
|
|
76
93
|
"./dist/types/plugins/deploy/exports.d.ts"
|
|
94
|
+
],
|
|
95
|
+
"builder": [
|
|
96
|
+
"./dist/types/builder/index.d.ts"
|
|
77
97
|
]
|
|
78
98
|
}
|
|
79
99
|
},
|
|
@@ -82,50 +102,44 @@
|
|
|
82
102
|
"modern-app": "./bin/modern.js"
|
|
83
103
|
},
|
|
84
104
|
"dependencies": {
|
|
85
|
-
"@babel/parser": "^7.
|
|
86
|
-
"@babel/traverse": "^7.
|
|
87
|
-
"@babel/types": "^7.
|
|
105
|
+
"@babel/parser": "^7.28.5",
|
|
106
|
+
"@babel/traverse": "^7.28.5",
|
|
107
|
+
"@babel/types": "^7.28.5",
|
|
88
108
|
"@rsbuild/core": "1.6.15",
|
|
89
|
-
"@rsbuild/plugin-node-polyfill": "1.4.2",
|
|
90
109
|
"@swc/helpers": "^0.5.17",
|
|
91
|
-
"es-module-lexer": "^1.
|
|
110
|
+
"es-module-lexer": "^1.7.0",
|
|
92
111
|
"esbuild": "0.25.5",
|
|
93
112
|
"esbuild-register": "^3.6.0",
|
|
94
113
|
"flatted": "^3.3.3",
|
|
95
|
-
"mlly": "^1.
|
|
114
|
+
"mlly": "^1.8.0",
|
|
96
115
|
"ndepe": "^0.1.12",
|
|
97
116
|
"pkg-types": "^1.3.1",
|
|
98
|
-
"std-env": "^3.
|
|
99
|
-
"@modern-js/
|
|
100
|
-
"@modern-js/
|
|
101
|
-
"@modern-js/plugin": "
|
|
102
|
-
"@modern-js/
|
|
103
|
-
"@modern-js/
|
|
104
|
-
"@modern-js/
|
|
105
|
-
"@modern-js/
|
|
106
|
-
"@modern-js/
|
|
107
|
-
"@modern-js/
|
|
108
|
-
"@modern-js/
|
|
109
|
-
"@modern-js/server-utils": "2.69.5",
|
|
110
|
-
"@modern-js/types": "2.69.5",
|
|
111
|
-
"@modern-js/uni-builder": "2.69.5",
|
|
112
|
-
"@modern-js/utils": "2.69.5"
|
|
117
|
+
"std-env": "^3.10.0",
|
|
118
|
+
"@modern-js/plugin-data-loader": "3.0.0-alpha.0",
|
|
119
|
+
"@modern-js/i18n-utils": "3.0.0-alpha.0",
|
|
120
|
+
"@modern-js/plugin": "3.0.0-alpha.0",
|
|
121
|
+
"@modern-js/prod-server": "3.0.0-alpha.0",
|
|
122
|
+
"@modern-js/server-core": "3.0.0-alpha.0",
|
|
123
|
+
"@modern-js/server": "3.0.0-alpha.0",
|
|
124
|
+
"@modern-js/server-utils": "3.0.0-alpha.0",
|
|
125
|
+
"@modern-js/types": "3.0.0-alpha.0",
|
|
126
|
+
"@modern-js/builder": "3.0.0-alpha.0",
|
|
127
|
+
"@modern-js/utils": "3.0.0-alpha.0"
|
|
113
128
|
},
|
|
114
129
|
"devDependencies": {
|
|
115
|
-
"@
|
|
116
|
-
"@types/babel__traverse": "7.
|
|
117
|
-
"@types/jest": "^29",
|
|
118
|
-
"@types/node": "^
|
|
119
|
-
"jest": "^29",
|
|
120
|
-
"ts-node": "^10.9.
|
|
130
|
+
"@rslib/core": "0.18.5",
|
|
131
|
+
"@types/babel__traverse": "7.28.0",
|
|
132
|
+
"@types/jest": "^29.5.14",
|
|
133
|
+
"@types/node": "^20",
|
|
134
|
+
"jest": "^29.7.0",
|
|
135
|
+
"ts-node": "^10.9.2",
|
|
121
136
|
"tsconfig-paths": "^4.2.0",
|
|
122
137
|
"typescript": "^5",
|
|
123
|
-
"
|
|
124
|
-
"@
|
|
125
|
-
"@scripts/jest-config": "2.66.0"
|
|
138
|
+
"@scripts/jest-config": "2.66.0",
|
|
139
|
+
"@modern-js/rslib": "2.68.10"
|
|
126
140
|
},
|
|
127
141
|
"peerDependencies": {
|
|
128
|
-
"ts-node": "^10.
|
|
142
|
+
"ts-node": "^10.9.2",
|
|
129
143
|
"tsconfig-paths": "^4.2.0"
|
|
130
144
|
},
|
|
131
145
|
"peerDependenciesMeta": {
|
|
@@ -142,9 +156,8 @@
|
|
|
142
156
|
"access": "public"
|
|
143
157
|
},
|
|
144
158
|
"scripts": {
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"build": "modern-lib build",
|
|
159
|
+
"dev": "rslib build --watch",
|
|
160
|
+
"build": "rslib build",
|
|
148
161
|
"test": "jest --passWithNoTests"
|
|
149
162
|
}
|
|
150
163
|
}
|
package/rslib.config.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { rslibConfig } from '@modern-js/rslib';
|
|
2
|
+
import { defineConfig } from '@rslib/core';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
...rslibConfig,
|
|
6
|
+
lib: rslibConfig.lib?.map(libConfig => {
|
|
7
|
+
return {
|
|
8
|
+
...libConfig,
|
|
9
|
+
output: {
|
|
10
|
+
...libConfig.output,
|
|
11
|
+
copy: [
|
|
12
|
+
{
|
|
13
|
+
from: './src/esm',
|
|
14
|
+
to: './esm',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var builder_webpack_exports = {};
|
|
30
|
-
__export(builder_webpack_exports, {
|
|
31
|
-
createWebpackBuilderForModern: () => createWebpackBuilderForModern
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(builder_webpack_exports);
|
|
34
|
-
var import_generator = require("../generator");
|
|
35
|
-
async function createWebpackBuilderForModern(options) {
|
|
36
|
-
const builder = await (0, import_generator.generateBuilder)(options, "webpack");
|
|
37
|
-
const { normalizedConfig } = options;
|
|
38
|
-
if (normalizedConfig.tools.esbuild) {
|
|
39
|
-
const { esbuild: esbuildOptions } = normalizedConfig.tools;
|
|
40
|
-
const { pluginEsbuild } = await import("@modern-js/rsbuild-plugin-esbuild");
|
|
41
|
-
builder.addPlugins([
|
|
42
|
-
pluginEsbuild(esbuildOptions)
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
return builder;
|
|
46
|
-
}
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
createWebpackBuilderForModern
|
|
50
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var createHtmlConfig_exports = {};
|
|
20
|
-
__export(createHtmlConfig_exports, {
|
|
21
|
-
createHtmlConfig: () => createHtmlConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(createHtmlConfig_exports);
|
|
24
|
-
function createHtmlConfig(config) {
|
|
25
|
-
const { disableHtmlFolder, favicon, faviconByEntries, inject, injectByEntries, meta, metaByEntries, mountId, title, titleByEntries, templateParameters, templateParametersByEntries, crossorigin } = config.output;
|
|
26
|
-
return {
|
|
27
|
-
disableHtmlFolder,
|
|
28
|
-
favicon,
|
|
29
|
-
faviconByEntries,
|
|
30
|
-
inject,
|
|
31
|
-
injectByEntries,
|
|
32
|
-
meta,
|
|
33
|
-
metaByEntries,
|
|
34
|
-
mountId,
|
|
35
|
-
title,
|
|
36
|
-
titleByEntries,
|
|
37
|
-
crossorigin,
|
|
38
|
-
templateParameters,
|
|
39
|
-
templateParametersByEntries
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
createHtmlConfig
|
|
45
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var createOutputConfig_exports = {};
|
|
20
|
-
__export(createOutputConfig_exports, {
|
|
21
|
-
createOutputConfig: () => createOutputConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(createOutputConfig_exports);
|
|
24
|
-
function createOutputConfig(config) {
|
|
25
|
-
const { assetPrefix, copy, cssModuleLocalIdentName, cssPath, jsPath, htmlPath, mediaPath, enableTsLoader, path, disableInlineRuntimeChunk, disableCssExtract, disableMinimize, disableSourceMap, disableTsChecker, enableCssModuleTSDeclaration, enableInlineScripts, enableInlineStyles, polyfill, dataUriLimit, disableAssetsCache, enableLatestDecorators, disableCssModuleExtension, ssg, disableNodePolyfill } = config.output;
|
|
26
|
-
return {
|
|
27
|
-
assetPrefix,
|
|
28
|
-
copy,
|
|
29
|
-
distPath: {
|
|
30
|
-
root: path,
|
|
31
|
-
css: cssPath,
|
|
32
|
-
js: jsPath,
|
|
33
|
-
html: htmlPath,
|
|
34
|
-
// modern.js v1 output all media files to `dist/media` by default
|
|
35
|
-
svg: mediaPath || "media",
|
|
36
|
-
image: mediaPath || "media",
|
|
37
|
-
font: mediaPath || "media",
|
|
38
|
-
media: mediaPath || "media"
|
|
39
|
-
},
|
|
40
|
-
dataUriLimit: {
|
|
41
|
-
svg: dataUriLimit,
|
|
42
|
-
image: dataUriLimit,
|
|
43
|
-
font: dataUriLimit,
|
|
44
|
-
media: dataUriLimit
|
|
45
|
-
},
|
|
46
|
-
cssModuleLocalIdentName,
|
|
47
|
-
disableCssExtract,
|
|
48
|
-
disableCssModuleExtension,
|
|
49
|
-
disableInlineRuntimeChunk,
|
|
50
|
-
disableMinimize,
|
|
51
|
-
disableSourceMap,
|
|
52
|
-
disableTsChecker: disableTsChecker || enableTsLoader,
|
|
53
|
-
enableCssModuleTSDeclaration,
|
|
54
|
-
enableInlineScripts,
|
|
55
|
-
enableInlineStyles,
|
|
56
|
-
polyfill,
|
|
57
|
-
disableFilenameHash: disableAssetsCache,
|
|
58
|
-
enableLatestDecorators,
|
|
59
|
-
ssg,
|
|
60
|
-
// set `true`, only in legacy config
|
|
61
|
-
enableAssetFallback: true,
|
|
62
|
-
enableAssetManifest: true,
|
|
63
|
-
disableNodePolyfill
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
createOutputConfig
|
|
69
|
-
});
|