@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,53 +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 createSourceConfig_exports = {};
|
|
20
|
-
__export(createSourceConfig_exports, {
|
|
21
|
-
createSourceConfig: () => createSourceConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(createSourceConfig_exports);
|
|
24
|
-
function createSourceConfig(config) {
|
|
25
|
-
const { alias, envVars, globalVars, include, moduleScopes, preEntry, entries, mainEntryName, enableAsyncEntry, enableCustomEntry, disableDefaultEntries, entriesDir, configDir } = config.source;
|
|
26
|
-
const builderGlobalVars = globalVars || {};
|
|
27
|
-
for (const envVar of envVars || []) {
|
|
28
|
-
const envVarValue = process.env[envVar];
|
|
29
|
-
envVarValue && (builderGlobalVars[`process.env.${envVar}`] = envVarValue);
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
alias,
|
|
33
|
-
moduleScopes,
|
|
34
|
-
globalVars: builderGlobalVars,
|
|
35
|
-
include,
|
|
36
|
-
preEntry,
|
|
37
|
-
entries,
|
|
38
|
-
mainEntryName,
|
|
39
|
-
enableAsyncEntry,
|
|
40
|
-
enableCustomEntry,
|
|
41
|
-
disableDefaultEntries,
|
|
42
|
-
entriesDir,
|
|
43
|
-
configDir,
|
|
44
|
-
resolveExtensionPrefix: {
|
|
45
|
-
web: ".web",
|
|
46
|
-
node: ".node"
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
-
0 && (module.exports = {
|
|
52
|
-
createSourceConfig
|
|
53
|
-
});
|
|
@@ -1,52 +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 createToolsConfig_exports = {};
|
|
20
|
-
__export(createToolsConfig_exports, {
|
|
21
|
-
createToolsConfig: () => createToolsConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(createToolsConfig_exports);
|
|
24
|
-
function createToolsConfig(config) {
|
|
25
|
-
const { autoprefixer, babel, minifyCss, terser, webpack, webpackChain, tsLoader, styledComponents, sass, postcss, less, htmlPlugin, devServer, tailwindcss, jest, esbuild } = config.tools;
|
|
26
|
-
const { enableTsLoader } = config.output;
|
|
27
|
-
return {
|
|
28
|
-
tsLoader: enableTsLoader ? tsLoader : void 0,
|
|
29
|
-
autoprefixer,
|
|
30
|
-
babel,
|
|
31
|
-
minifyCss,
|
|
32
|
-
terser,
|
|
33
|
-
webpack,
|
|
34
|
-
webpackChain,
|
|
35
|
-
styledComponents,
|
|
36
|
-
sass,
|
|
37
|
-
postcss,
|
|
38
|
-
less,
|
|
39
|
-
htmlPlugin,
|
|
40
|
-
devServer,
|
|
41
|
-
tailwindcss,
|
|
42
|
-
jest,
|
|
43
|
-
esbuild: {
|
|
44
|
-
loader: false,
|
|
45
|
-
minimize: esbuild
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
createToolsConfig
|
|
52
|
-
});
|
|
@@ -1,68 +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 legacy_exports = {};
|
|
20
|
-
__export(legacy_exports, {
|
|
21
|
-
checkIsLegacyConfig: () => checkIsLegacyConfig,
|
|
22
|
-
transformNormalizedConfig: () => transformNormalizedConfig
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(legacy_exports);
|
|
25
|
-
var import_createHtmlConfig = require("./createHtmlConfig");
|
|
26
|
-
var import_createOutputConfig = require("./createOutputConfig");
|
|
27
|
-
var import_createSourceConfig = require("./createSourceConfig");
|
|
28
|
-
var import_createToolsConfig = require("./createToolsConfig");
|
|
29
|
-
function transformNormalizedConfig(config) {
|
|
30
|
-
const html = (0, import_createHtmlConfig.createHtmlConfig)(config);
|
|
31
|
-
const output = (0, import_createOutputConfig.createOutputConfig)(config);
|
|
32
|
-
const source = (0, import_createSourceConfig.createSourceConfig)(config);
|
|
33
|
-
const tools = (0, import_createToolsConfig.createToolsConfig)(config);
|
|
34
|
-
const { bff, dev, deploy, runtime, runtimeByEntries, server, cliOptions, plugins, testing, autoLoadPlugins } = config;
|
|
35
|
-
return {
|
|
36
|
-
resolve: {},
|
|
37
|
-
source,
|
|
38
|
-
html,
|
|
39
|
-
output,
|
|
40
|
-
tools,
|
|
41
|
-
bff,
|
|
42
|
-
dev,
|
|
43
|
-
deploy,
|
|
44
|
-
runtime,
|
|
45
|
-
runtimeByEntries,
|
|
46
|
-
server,
|
|
47
|
-
cliOptions,
|
|
48
|
-
testing,
|
|
49
|
-
builderPlugins: [],
|
|
50
|
-
plugins,
|
|
51
|
-
security: {},
|
|
52
|
-
_raw: {},
|
|
53
|
-
experiments: {},
|
|
54
|
-
environments: {},
|
|
55
|
-
autoLoadPlugins,
|
|
56
|
-
performance: {
|
|
57
|
-
removeMomentLocale: true
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function checkIsLegacyConfig(config) {
|
|
62
|
-
return Boolean(config.legacy);
|
|
63
|
-
}
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
checkIsLegacyConfig,
|
|
67
|
-
transformNormalizedConfig
|
|
68
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { handler as default } from './netlify-handler.cjs';
|
package/dist/cjs/types/hooks.js
DELETED
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var hooks_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(hooks_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var deploy_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(deploy_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var dev_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(dev_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var legacyConfig_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(legacyConfig_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var output_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(output_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var source_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(source_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var testing_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(testing_exports);
|
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var tools_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(tools_exports);
|
package/dist/cjs/types/new.js
DELETED
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var new_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(new_exports);
|
|
@@ -1,34 +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 getUserConfig_exports = {};
|
|
20
|
-
__export(getUserConfig_exports, {
|
|
21
|
-
getUserConfig: () => getUserConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(getUserConfig_exports);
|
|
24
|
-
var import_cli = require("@modern-js/plugin-v2/cli");
|
|
25
|
-
async function getUserConfig(appDirectory, configFile, packageJsonConfig, metaName) {
|
|
26
|
-
const envName = metaName === "modern-js" ? "MODERN" : metaName;
|
|
27
|
-
(0, import_cli.loadEnv)(appDirectory, process.env[`${envName.toUpperCase()}_ENV`]);
|
|
28
|
-
const loaded = await (0, import_cli.createLoadedConfig)(appDirectory, configFile, packageJsonConfig);
|
|
29
|
-
return loaded.config || {};
|
|
30
|
-
}
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
getUserConfig
|
|
34
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
-
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
-
import { generateBuilder } from "../generator";
|
|
4
|
-
function createRspackBuilderForModern(options) {
|
|
5
|
-
return _createRspackBuilderForModern.apply(this, arguments);
|
|
6
|
-
}
|
|
7
|
-
function _createRspackBuilderForModern() {
|
|
8
|
-
_createRspackBuilderForModern = _async_to_generator(function(options) {
|
|
9
|
-
var builder;
|
|
10
|
-
return _ts_generator(this, function(_state) {
|
|
11
|
-
switch (_state.label) {
|
|
12
|
-
case 0:
|
|
13
|
-
return [
|
|
14
|
-
4,
|
|
15
|
-
generateBuilder(options, "rspack")
|
|
16
|
-
];
|
|
17
|
-
case 1:
|
|
18
|
-
builder = _state.sent();
|
|
19
|
-
return [
|
|
20
|
-
2,
|
|
21
|
-
builder
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
return _createRspackBuilderForModern.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
createRspackBuilderForModern
|
|
30
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
-
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
-
import { generateBuilder } from "../generator";
|
|
4
|
-
function createWebpackBuilderForModern(options) {
|
|
5
|
-
return _createWebpackBuilderForModern.apply(this, arguments);
|
|
6
|
-
}
|
|
7
|
-
function _createWebpackBuilderForModern() {
|
|
8
|
-
_createWebpackBuilderForModern = _async_to_generator(function(options) {
|
|
9
|
-
var builder, normalizedConfig, _normalizedConfig_tools, esbuildOptions, pluginEsbuild;
|
|
10
|
-
return _ts_generator(this, function(_state) {
|
|
11
|
-
switch (_state.label) {
|
|
12
|
-
case 0:
|
|
13
|
-
return [
|
|
14
|
-
4,
|
|
15
|
-
generateBuilder(options, "webpack")
|
|
16
|
-
];
|
|
17
|
-
case 1:
|
|
18
|
-
builder = _state.sent();
|
|
19
|
-
normalizedConfig = options.normalizedConfig;
|
|
20
|
-
if (!normalizedConfig.tools.esbuild)
|
|
21
|
-
return [
|
|
22
|
-
3,
|
|
23
|
-
3
|
|
24
|
-
];
|
|
25
|
-
_normalizedConfig_tools = normalizedConfig.tools, esbuildOptions = _normalizedConfig_tools.esbuild;
|
|
26
|
-
return [
|
|
27
|
-
4,
|
|
28
|
-
import("@modern-js/rsbuild-plugin-esbuild")
|
|
29
|
-
];
|
|
30
|
-
case 2:
|
|
31
|
-
pluginEsbuild = _state.sent().pluginEsbuild;
|
|
32
|
-
builder.addPlugins([
|
|
33
|
-
pluginEsbuild(esbuildOptions)
|
|
34
|
-
]);
|
|
35
|
-
_state.label = 3;
|
|
36
|
-
case 3:
|
|
37
|
-
return [
|
|
38
|
-
2,
|
|
39
|
-
builder
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
return _createWebpackBuilderForModern.apply(this, arguments);
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
createWebpackBuilderForModern
|
|
48
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
2
|
-
import { createPublicPattern } from "./createCopyPattern";
|
|
3
|
-
var builderPluginAdapterCopy = function(options) {
|
|
4
|
-
return {
|
|
5
|
-
name: "builder-plugin-adapter-copy",
|
|
6
|
-
setup: function setup(api) {
|
|
7
|
-
var modernConfig = options.normalizedConfig, appContext = options.appContext;
|
|
8
|
-
api.modifyBundlerChain(function(chain, param) {
|
|
9
|
-
var CHAIN_ID = param.CHAIN_ID;
|
|
10
|
-
if (chain.plugins.has(CHAIN_ID.PLUGIN.COPY)) {
|
|
11
|
-
var defaultCopyPattern = createPublicPattern(appContext, modernConfig, chain);
|
|
12
|
-
chain.plugin(CHAIN_ID.PLUGIN.COPY).tap(function(args) {
|
|
13
|
-
var _args_;
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
patterns: _to_consumable_array(((_args_ = args[0]) === null || _args_ === void 0 ? void 0 : _args_.patterns) || []).concat([
|
|
17
|
-
defaultCopyPattern
|
|
18
|
-
])
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
builderPluginAdapterCopy
|
|
29
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
-
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
-
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
4
|
-
import { DEFAULT_API_PREFIX } from "@modern-js/utils";
|
|
5
|
-
import { createUploadPattern } from "./createCopyPattern";
|
|
6
|
-
function modifyOutputConfig(config, appContext) {
|
|
7
|
-
var defaultCopyPattern = createUploadPattern(appContext, config);
|
|
8
|
-
var copy = config.output.copy;
|
|
9
|
-
var copyOptions = Array.isArray(copy) ? copy : copy === null || copy === void 0 ? void 0 : copy.patterns;
|
|
10
|
-
var builderCopy = _to_consumable_array(copyOptions || []).concat([
|
|
11
|
-
defaultCopyPattern
|
|
12
|
-
]);
|
|
13
|
-
config.output = _object_spread_props(_object_spread({}, config.output), {
|
|
14
|
-
copy: builderCopy
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function createBuilderProviderConfig(resolveConfig, appContext) {
|
|
18
|
-
var _resolveConfig_tools;
|
|
19
|
-
var htmlConfig = _object_spread({}, resolveConfig.html);
|
|
20
|
-
if (!htmlConfig.template) {
|
|
21
|
-
htmlConfig.templateByEntries = _object_spread({}, appContext.htmlTemplates, htmlConfig.templateByEntries);
|
|
22
|
-
}
|
|
23
|
-
var config = _object_spread_props(_object_spread({}, resolveConfig), {
|
|
24
|
-
plugins: [],
|
|
25
|
-
resolve: _object_spread({}, resolveConfig.resolve),
|
|
26
|
-
dev: _object_spread_props(_object_spread({}, resolveConfig.dev), {
|
|
27
|
-
port: appContext.port
|
|
28
|
-
}),
|
|
29
|
-
server: resolveConfig.server,
|
|
30
|
-
html: htmlConfig,
|
|
31
|
-
output: _object_spread_props(_object_spread({}, resolveConfig.output), {
|
|
32
|
-
// We need to do this in the app-tools prepare hook because some files will be generated into the dist directory in the analyze process
|
|
33
|
-
cleanDistPath: false
|
|
34
|
-
}),
|
|
35
|
-
tools: _object_spread_props(_object_spread({}, resolveConfig.tools), {
|
|
36
|
-
devServer: _object_spread_props(_object_spread({}, (_resolveConfig_tools = resolveConfig.tools) === null || _resolveConfig_tools === void 0 ? void 0 : _resolveConfig_tools.devServer), {
|
|
37
|
-
compress: {
|
|
38
|
-
filter: function(req) {
|
|
39
|
-
var _resolveConfig_bff;
|
|
40
|
-
var bffPrefix = ((_resolveConfig_bff = resolveConfig.bff) === null || _resolveConfig_bff === void 0 ? void 0 : _resolveConfig_bff.prefix) || DEFAULT_API_PREFIX;
|
|
41
|
-
var url = req.url;
|
|
42
|
-
if (url === null || url === void 0 ? void 0 : url.startsWith(bffPrefix)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
modifyOutputConfig(config, appContext);
|
|
52
|
-
return config;
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
createBuilderProviderConfig
|
|
56
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { removeTailSlash } from "@modern-js/utils";
|
|
2
|
-
import { createCopyInfo } from "../shared";
|
|
3
|
-
var minifiedJsRexExp = /\.min\.js/;
|
|
4
|
-
var info = function(file) {
|
|
5
|
-
return {
|
|
6
|
-
// If the file name ends with `.min.js`, we assume it's a compressed file.
|
|
7
|
-
// So we don't want copy-webpack-plugin to minify it.
|
|
8
|
-
// ref: https://github.com/webpack-contrib/copy-webpack-plugin#info
|
|
9
|
-
minimized: minifiedJsRexExp.test(file.sourceFilename)
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
function createPublicPattern(appContext, config, chain) {
|
|
13
|
-
var publicDir = createCopyInfo(appContext, config).publicDir;
|
|
14
|
-
return {
|
|
15
|
-
info,
|
|
16
|
-
from: "**/*",
|
|
17
|
-
to: "public",
|
|
18
|
-
context: publicDir,
|
|
19
|
-
noErrorOnMissing: true,
|
|
20
|
-
transform: function(content, absoluteFrom) {
|
|
21
|
-
if (!/\.html?$/.test(absoluteFrom)) {
|
|
22
|
-
return content;
|
|
23
|
-
}
|
|
24
|
-
return content.toString("utf8").replace(/<%=\s*assetPrefix\s*%>/g, removeTailSlash(chain.output.get("publicPath")));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function createUploadPattern(appContext, config) {
|
|
29
|
-
var uploadDir = createCopyInfo(appContext, config).uploadDir;
|
|
30
|
-
return {
|
|
31
|
-
// rspack copy info structure is inconsistent with webpack, it only used in webpack mode
|
|
32
|
-
// @ts-expect-error
|
|
33
|
-
info,
|
|
34
|
-
from: "**/*",
|
|
35
|
-
to: "upload",
|
|
36
|
-
context: uploadDir,
|
|
37
|
-
noErrorOnMissing: true
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
createPublicPattern,
|
|
42
|
-
createUploadPattern
|
|
43
|
-
};
|