@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.98 → 3.5.0-ultramodern.99
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/dist/cjs/builder/generator/createBuilderProviderConfig.js +5 -1
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +7 -0
- package/dist/cjs/commands/build.js +2 -1
- package/dist/cjs/commands/deploy.js +4 -2
- package/dist/cjs/commands/index.js +0 -4
- package/dist/cjs/config/default.js +2 -0
- package/dist/cjs/index.js +56 -15
- package/dist/cjs/plugins/analyze/index.js +2 -2
- package/dist/cjs/plugins/analyze/utils.js +3 -2
- package/dist/cjs/plugins/initialize/index.js +4 -3
- package/dist/cjs/plugins/serverBuild.js +3 -2
- package/dist/esm/builder/generator/createBuilderProviderConfig.mjs +5 -1
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +7 -0
- package/dist/esm/commands/build.mjs +2 -1
- package/dist/esm/commands/deploy.mjs +4 -2
- package/dist/esm/commands/index.mjs +0 -4
- package/dist/esm/config/default.mjs +2 -0
- package/dist/esm/index.mjs +15 -1
- package/dist/esm/plugins/analyze/index.mjs +2 -2
- package/dist/esm/plugins/analyze/utils.mjs +3 -2
- package/dist/esm/plugins/initialize/index.mjs +4 -3
- package/dist/esm/plugins/serverBuild.mjs +3 -2
- package/dist/esm-node/builder/generator/createBuilderProviderConfig.mjs +5 -1
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +7 -0
- package/dist/esm-node/commands/build.mjs +2 -1
- package/dist/esm-node/commands/deploy.mjs +4 -2
- package/dist/esm-node/commands/index.mjs +0 -4
- package/dist/esm-node/config/default.mjs +2 -0
- package/dist/esm-node/index.mjs +15 -1
- package/dist/esm-node/plugins/analyze/index.mjs +2 -2
- package/dist/esm-node/plugins/analyze/utils.mjs +3 -2
- package/dist/esm-node/plugins/initialize/index.mjs +4 -3
- package/dist/esm-node/plugins/serverBuild.mjs +3 -2
- package/dist/types/commands/deploy.d.ts +2 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/plugins/analyze/utils.d.ts +1 -1
- package/dist/types/types/config/dev.d.ts +6 -0
- package/docs/_nav.json +36 -0
- package/docs/apis/_meta.json +13 -0
- package/docs/apis/app/commands.mdx +205 -0
- package/docs/apis/app/hooks/_meta.json +28 -0
- package/docs/apis/app/hooks/api/lambda.mdx +13 -0
- package/docs/apis/app/hooks/config/_meta.json +1 -0
- package/docs/apis/app/hooks/config/favicon.mdx +29 -0
- package/docs/apis/app/hooks/config/html.mdx +9 -0
- package/docs/apis/app/hooks/config/icon.mdx +29 -0
- package/docs/apis/app/hooks/config/mock.mdx +10 -0
- package/docs/apis/app/hooks/config/public.mdx +30 -0
- package/docs/apis/app/hooks/config/upload.mdx +54 -0
- package/docs/apis/app/hooks/modern-config.mdx +9 -0
- package/docs/apis/app/hooks/server/server.mdx +10 -0
- package/docs/apis/app/hooks/shared.mdx +7 -0
- package/docs/apis/app/hooks/src/app.mdx +30 -0
- package/docs/apis/app/hooks/src/entry.mdx +39 -0
- package/docs/apis/app/hooks/src/entry.server.mdx +56 -0
- package/docs/apis/app/hooks/src/modern.runtime.mdx +9 -0
- package/docs/apis/app/hooks/src/routes.mdx +90 -0
- package/docs/apis/app/hooks/src/server.mdx +7 -0
- package/docs/apis/app/runtime/_meta.json +32 -0
- package/docs/apis/app/runtime/bff/use-backend-context.mdx +30 -0
- package/docs/apis/app/runtime/core/create-root.mdx +22 -0
- package/docs/apis/app/runtime/core/render.mdx +42 -0
- package/docs/apis/app/runtime/core/runtime-context.mdx +160 -0
- package/docs/apis/app/runtime/router/router.mdx +288 -0
- package/docs/apis/app/runtime/ssr/no-ssr.mdx +38 -0
- package/docs/apis/app/runtime/ssr/renderStreaming.mdx +71 -0
- package/docs/apis/app/runtime/ssr/renderString.mdx +64 -0
- package/docs/apis/app/runtime/ssr/requestHandler.mdx +48 -0
- package/docs/apis/app/runtime/utility/css-in-js.mdx +44 -0
- package/docs/apis/app/runtime/utility/head.mdx +38 -0
- package/docs/apis/app/runtime/utility/loadable.mdx +85 -0
- package/docs/components/auto-upgrade.mdx +0 -0
- package/docs/components/bff-upload.mdx +97 -0
- package/docs/components/build-output.mdx +45 -0
- package/docs/components/bundler.mdx +3 -0
- package/docs/components/convention-routing-motivation.mdx +0 -0
- package/docs/components/debug-app.mdx +15 -0
- package/docs/components/default-browserslist.mdx +7 -0
- package/docs/components/deploy-command.mdx +14 -0
- package/docs/components/deploy.mdx +1 -0
- package/docs/components/enable-bff-caution.mdx +3 -0
- package/docs/components/enable-bff.mdx +56 -0
- package/docs/components/enable-ssg.mdx +49 -0
- package/docs/components/entry-mode.mdx +0 -0
- package/docs/components/entry-scan-logic.mdx +7 -0
- package/docs/components/extend-bff-function.mdx +3 -0
- package/docs/components/hono.mdx +120 -0
- package/docs/components/init-app.mdx +93 -0
- package/docs/components/init-rspack-app.mdx +5 -0
- package/docs/components/internal-logger.mdx +25 -0
- package/docs/components/internal-metrics.mdx +20 -0
- package/docs/components/international/custom-instance-code.mdx +16 -0
- package/docs/components/international/init-options-desc.mdx +1 -0
- package/docs/components/international/install-command.mdx +10 -0
- package/docs/components/international/instance-code.mdx +16 -0
- package/docs/components/international/introduce.mdx +5 -0
- package/docs/components/international/platform-support.mdx +0 -0
- package/docs/components/language-config.mdx +9 -0
- package/docs/components/micro-frontend.mdx +6 -0
- package/docs/components/micro-master-manifest-config.mdx +15 -0
- package/docs/components/micro-runtime-config.mdx +17 -0
- package/docs/components/module-federation.mdx +7 -0
- package/docs/components/new-entry-tooltip.mdx +0 -0
- package/docs/components/nodeVersion.mdx +28 -0
- package/docs/components/other-plugins.mdx +0 -0
- package/docs/components/output-asset-prefix-extend.mdx +0 -0
- package/docs/components/output-distpath-warning.mdx +0 -0
- package/docs/components/output-polyfill-extend.mdx +1 -0
- package/docs/components/prerequisites.mdx +18 -0
- package/docs/components/release-note.mdx +1 -0
- package/docs/components/routes-practice.mdx +0 -0
- package/docs/components/rsbuild-config-tooltip.mdx +5 -0
- package/docs/components/rsbuild.mdx +3 -0
- package/docs/components/rsc-deploy-tip.mdx +1 -0
- package/docs/components/rspack.mdx +3 -0
- package/docs/components/rspackTip.mdx +7 -0
- package/docs/components/runtime-cli-config.mdx +0 -0
- package/docs/components/serve-command.mdx +22 -0
- package/docs/components/ssr-monitor.mdx +3 -0
- package/docs/components/stream-ssr-performance.mdx +0 -0
- package/docs/components/swc.mdx +3 -0
- package/docs/components/tech-stack-node-framework.mdx +1 -0
- package/docs/components/turtorials-example-list.mdx +2 -0
- package/docs/components/ua-polyfill.mdx +44 -0
- package/docs/components/upgrade-browserslist.mdx +0 -0
- package/docs/components/upgrade-config-deploy.mdx +0 -0
- package/docs/components/upgrade-faq.mdx +0 -0
- package/docs/configure/_meta.json +78 -0
- package/docs/configure/app/bff/cross-project.mdx +24 -0
- package/docs/configure/app/bff/effect.mdx +319 -0
- package/docs/configure/app/bff/prefix.mdx +33 -0
- package/docs/configure/app/bff/runtime-framework.mdx +30 -0
- package/docs/configure/app/builder-plugins.mdx +70 -0
- package/docs/configure/app/dev/asset-prefix.mdx +18 -0
- package/docs/configure/app/dev/before-start-url.mdx +21 -0
- package/docs/configure/app/dev/client.mdx +45 -0
- package/docs/configure/app/dev/hmr.mdx +14 -0
- package/docs/configure/app/dev/host.mdx +22 -0
- package/docs/configure/app/dev/https.mdx +81 -0
- package/docs/configure/app/dev/lazy-compilation.mdx +45 -0
- package/docs/configure/app/dev/live-reload.mdx +14 -0
- package/docs/configure/app/dev/mock-dir.mdx +35 -0
- package/docs/configure/app/dev/progress-bar.mdx +23 -0
- package/docs/configure/app/dev/server.mdx +128 -0
- package/docs/configure/app/dev/setup-middlewares.mdx +36 -0
- package/docs/configure/app/dev/start-url.mdx +53 -0
- package/docs/configure/app/dev/watch-files.mdx +31 -0
- package/docs/configure/app/dev/write-to-disk.mdx +14 -0
- package/docs/configure/app/experiments/source-build.mdx +33 -0
- package/docs/configure/app/html/app-icon.mdx +32 -0
- package/docs/configure/app/html/crossorigin.mdx +14 -0
- package/docs/configure/app/html/favicon.mdx +20 -0
- package/docs/configure/app/html/inject.mdx +14 -0
- package/docs/configure/app/html/meta.mdx +28 -0
- package/docs/configure/app/html/mount-id.mdx +14 -0
- package/docs/configure/app/html/output-structure.mdx +14 -0
- package/docs/configure/app/html/script-loading.mdx +14 -0
- package/docs/configure/app/html/tags.mdx +19 -0
- package/docs/configure/app/html/template-parameters.mdx +37 -0
- package/docs/configure/app/html/template.mdx +14 -0
- package/docs/configure/app/html/title.mdx +22 -0
- package/docs/configure/app/output/asset-prefix.mdx +18 -0
- package/docs/configure/app/output/assets-retry.mdx +81 -0
- package/docs/configure/app/output/charset.mdx +14 -0
- package/docs/configure/app/output/clean-dist-path.mdx +20 -0
- package/docs/configure/app/output/convert-to-rem.mdx +83 -0
- package/docs/configure/app/output/copy.mdx +14 -0
- package/docs/configure/app/output/css-modules.mdx +52 -0
- package/docs/configure/app/output/data-uri-limit.mdx +30 -0
- package/docs/configure/app/output/disable-css-module-extension.mdx +59 -0
- package/docs/configure/app/output/disable-inline-runtime-chunk.mdx +45 -0
- package/docs/configure/app/output/disable-svgr.mdx +22 -0
- package/docs/configure/app/output/disable-ts-checker.mdx +53 -0
- package/docs/configure/app/output/dist-path.mdx +51 -0
- package/docs/configure/app/output/enable-asset-manifest.mdx +40 -0
- package/docs/configure/app/output/enable-css-module-tsdeclaration.mdx +32 -0
- package/docs/configure/app/output/enable-inline-route-manifests.mdx +20 -0
- package/docs/configure/app/output/externals.mdx +24 -0
- package/docs/configure/app/output/filename-hash.mdx +14 -0
- package/docs/configure/app/output/filename.mdx +59 -0
- package/docs/configure/app/output/inject-styles.mdx +14 -0
- package/docs/configure/app/output/inline-scripts.mdx +33 -0
- package/docs/configure/app/output/inline-styles.mdx +33 -0
- package/docs/configure/app/output/legal-comments.mdx +22 -0
- package/docs/configure/app/output/minify.mdx +26 -0
- package/docs/configure/app/output/override-browserslist.mdx +26 -0
- package/docs/configure/app/output/polyfill.mdx +18 -0
- package/docs/configure/app/output/source-map.mdx +34 -0
- package/docs/configure/app/output/split-route-chunks.mdx +20 -0
- package/docs/configure/app/output/ssg.mdx +85 -0
- package/docs/configure/app/output/ssgByEntries.mdx +93 -0
- package/docs/configure/app/output/svg-default-export.mdx +34 -0
- package/docs/configure/app/output/temp-dir.mdx +24 -0
- package/docs/configure/app/performance/build-cache.mdx +48 -0
- package/docs/configure/app/performance/chunk-split.mdx +44 -0
- package/docs/configure/app/performance/dns-prefetch.mdx +19 -0
- package/docs/configure/app/performance/preconnect.mdx +20 -0
- package/docs/configure/app/performance/prefetch.mdx +25 -0
- package/docs/configure/app/performance/preload.mdx +27 -0
- package/docs/configure/app/performance/print-file-size.mdx +44 -0
- package/docs/configure/app/performance/profile.mdx +14 -0
- package/docs/configure/app/performance/remove-console.mdx +14 -0
- package/docs/configure/app/performance/remove-moment-locale.mdx +14 -0
- package/docs/configure/app/performance/rsdoctor.mdx +42 -0
- package/docs/configure/app/plugins.mdx +59 -0
- package/docs/configure/app/resolve/alias-strategy.mdx +14 -0
- package/docs/configure/app/resolve/alias.mdx +13 -0
- package/docs/configure/app/resolve/condition-names.mdx +18 -0
- package/docs/configure/app/resolve/dedupe.mdx +13 -0
- package/docs/configure/app/resolve/extensions.mdx +18 -0
- package/docs/configure/app/runtime/0-intro.mdx +61 -0
- package/docs/configure/app/runtime/plugins.mdx +58 -0
- package/docs/configure/app/runtime/router.mdx +39 -0
- package/docs/configure/app/security/check-syntax.mdx +73 -0
- package/docs/configure/app/security/nonce.mdx +19 -0
- package/docs/configure/app/security/sri.mdx +24 -0
- package/docs/configure/app/server/base-url.mdx +30 -0
- package/docs/configure/app/server/port.mdx +22 -0
- package/docs/configure/app/server/public-routes.mdx +26 -0
- package/docs/configure/app/server/routes.mdx +90 -0
- package/docs/configure/app/server/rsc.mdx +30 -0
- package/docs/configure/app/server/ssr-by-entries.mdx +29 -0
- package/docs/configure/app/server/ssr.mdx +85 -0
- package/docs/configure/app/server/tsconfig-path.mdx +63 -0
- package/docs/configure/app/source/alias-strategy.mdx +18 -0
- package/docs/configure/app/source/alias.mdx +27 -0
- package/docs/configure/app/source/config-dir.mdx +24 -0
- package/docs/configure/app/source/decorators.mdx +29 -0
- package/docs/configure/app/source/define.mdx +20 -0
- package/docs/configure/app/source/disable-default-entries.mdx +32 -0
- package/docs/configure/app/source/enable-async-entry.mdx +54 -0
- package/docs/configure/app/source/enable-async-pre-entry.mdx +30 -0
- package/docs/configure/app/source/entries-dir.mdx +39 -0
- package/docs/configure/app/source/entries.mdx +183 -0
- package/docs/configure/app/source/exclude.mdx +14 -0
- package/docs/configure/app/source/global-vars.mdx +110 -0
- package/docs/configure/app/source/include.mdx +40 -0
- package/docs/configure/app/source/main-entry-name.mdx +28 -0
- package/docs/configure/app/source/pre-entry.mdx +14 -0
- package/docs/configure/app/source/react-compiler.mdx +72 -0
- package/docs/configure/app/source/transform-import.mdx +31 -0
- package/docs/configure/app/split-chunks.mdx +17 -0
- package/docs/configure/app/tools/autoprefixer.mdx +48 -0
- package/docs/configure/app/tools/bundler-chain.mdx +30 -0
- package/docs/configure/app/tools/css-extract.mdx +37 -0
- package/docs/configure/app/tools/css-loader.mdx +21 -0
- package/docs/configure/app/tools/dev-server.mdx +117 -0
- package/docs/configure/app/tools/html-plugin.mdx +45 -0
- package/docs/configure/app/tools/less.mdx +85 -0
- package/docs/configure/app/tools/lightningcss-loader.mdx +39 -0
- package/docs/configure/app/tools/minify-css.mdx +57 -0
- package/docs/configure/app/tools/postcss.mdx +38 -0
- package/docs/configure/app/tools/rspack.mdx +14 -0
- package/docs/configure/app/tools/sass.mdx +82 -0
- package/docs/configure/app/tools/style-loader.mdx +14 -0
- package/docs/configure/app/tools/swc.mdx +69 -0
- package/docs/configure/app/tools/ts-checker.mdx +103 -0
- package/docs/configure/app/usage.mdx +276 -0
- package/docs/guides/_meta.json +37 -0
- package/docs/guides/advanced-features/_meta.json +32 -0
- package/docs/guides/advanced-features/bff/_meta.json +10 -0
- package/docs/guides/advanced-features/bff/cross-project.mdx +110 -0
- package/docs/guides/advanced-features/bff/data-platform.mdx +120 -0
- package/docs/guides/advanced-features/bff/extend-server.mdx +120 -0
- package/docs/guides/advanced-features/bff/frameworks.mdx +131 -0
- package/docs/guides/advanced-features/bff/function.mdx +265 -0
- package/docs/guides/advanced-features/bff/operators.mdx +629 -0
- package/docs/guides/advanced-features/bff/sdk.mdx +116 -0
- package/docs/guides/advanced-features/bff/upload.mdx +7 -0
- package/docs/guides/advanced-features/bff.mdx +22 -0
- package/docs/guides/advanced-features/build-performance.mdx +134 -0
- package/docs/guides/advanced-features/compatibility.mdx +81 -0
- package/docs/guides/advanced-features/international/_meta.json +10 -0
- package/docs/guides/advanced-features/international/advanced.mdx +132 -0
- package/docs/guides/advanced-features/international/api.mdx +271 -0
- package/docs/guides/advanced-features/international/best-practices.mdx +290 -0
- package/docs/guides/advanced-features/international/configuration.mdx +222 -0
- package/docs/guides/advanced-features/international/locale-detection.mdx +130 -0
- package/docs/guides/advanced-features/international/quick-start.mdx +112 -0
- package/docs/guides/advanced-features/international/resource-loading.mdx +158 -0
- package/docs/guides/advanced-features/international/routing.mdx +177 -0
- package/docs/guides/advanced-features/international.mdx +29 -0
- package/docs/guides/advanced-features/low-level.mdx +50 -0
- package/docs/guides/advanced-features/page-performance/_meta.json +1 -0
- package/docs/guides/advanced-features/page-performance/code-split.mdx +81 -0
- package/docs/guides/advanced-features/page-performance/inline-assets.mdx +163 -0
- package/docs/guides/advanced-features/page-performance/optimize-bundle.mdx +101 -0
- package/docs/guides/advanced-features/page-performance/react-compiler.mdx +51 -0
- package/docs/guides/advanced-features/server-monitor/_meta.json +1 -0
- package/docs/guides/advanced-features/server-monitor/logger.mdx +19 -0
- package/docs/guides/advanced-features/server-monitor/metrics.mdx +41 -0
- package/docs/guides/advanced-features/server-monitor/monitors.mdx +242 -0
- package/docs/guides/advanced-features/source-build.mdx +168 -0
- package/docs/guides/advanced-features/web-server.mdx +296 -0
- package/docs/guides/basic-features/_meta.json +49 -0
- package/docs/guides/basic-features/alias.mdx +106 -0
- package/docs/guides/basic-features/css/_meta.json +1 -0
- package/docs/guides/basic-features/css/css-in-js.mdx +69 -0
- package/docs/guides/basic-features/css/css-modules.mdx +212 -0
- package/docs/guides/basic-features/css/css.mdx +31 -0
- package/docs/guides/basic-features/css/tailwindcss.mdx +27 -0
- package/docs/guides/basic-features/data/_meta.json +1 -0
- package/docs/guides/basic-features/data/data-cache.mdx +515 -0
- package/docs/guides/basic-features/data/data-fetch.mdx +419 -0
- package/docs/guides/basic-features/data/data-write.mdx +230 -0
- package/docs/guides/basic-features/debug/_meta.json +1 -0
- package/docs/guides/basic-features/debug/mock.mdx +113 -0
- package/docs/guides/basic-features/debug/proxy.mdx +25 -0
- package/docs/guides/basic-features/debug/rsdoctor.mdx +47 -0
- package/docs/guides/basic-features/debug/using-storybook.mdx +100 -0
- package/docs/guides/basic-features/deploy.mdx +448 -0
- package/docs/guides/basic-features/env-vars.mdx +181 -0
- package/docs/guides/basic-features/html.mdx +259 -0
- package/docs/guides/basic-features/output-files.mdx +145 -0
- package/docs/guides/basic-features/render/_meta.json +1 -0
- package/docs/guides/basic-features/render/before-render.mdx +108 -0
- package/docs/guides/basic-features/render/overview.mdx +51 -0
- package/docs/guides/basic-features/render/rsc.mdx +533 -0
- package/docs/guides/basic-features/render/ssg.mdx +167 -0
- package/docs/guides/basic-features/render/ssr-cache.mdx +201 -0
- package/docs/guides/basic-features/render/ssr.mdx +323 -0
- package/docs/guides/basic-features/render/streaming-ssr.mdx +267 -0
- package/docs/guides/basic-features/routes/_meta.json +1 -0
- package/docs/guides/basic-features/routes/config-routes.mdx +427 -0
- package/docs/guides/basic-features/routes/routes.mdx +532 -0
- package/docs/guides/basic-features/static-assets/_meta.json +1 -0
- package/docs/guides/basic-features/static-assets/json-files.mdx +124 -0
- package/docs/guides/basic-features/static-assets/svg-assets.mdx +172 -0
- package/docs/guides/basic-features/static-assets/wasm-assets.mdx +66 -0
- package/docs/guides/basic-features/static-assets.mdx +164 -0
- package/docs/guides/basic-features/testing/_meta.json +1 -0
- package/docs/guides/basic-features/testing/playwright.mdx +111 -0
- package/docs/guides/basic-features/testing/rstest.mdx +192 -0
- package/docs/guides/concept/_meta.json +1 -0
- package/docs/guides/concept/builder.mdx +60 -0
- package/docs/guides/concept/entries.mdx +325 -0
- package/docs/guides/concept/server.mdx +35 -0
- package/docs/guides/get-started/_meta.json +9 -0
- package/docs/guides/get-started/ai-coding-agents.mdx +63 -0
- package/docs/guides/get-started/glossary.mdx +63 -0
- package/docs/guides/get-started/introduction.mdx +45 -0
- package/docs/guides/get-started/quick-start.mdx +92 -0
- package/docs/guides/get-started/tech-stack.mdx +97 -0
- package/docs/guides/get-started/ultramodern.mdx +433 -0
- package/docs/guides/get-started/upgrade.mdx +114 -0
- package/docs/guides/topic-detail/_meta.json +8 -0
- package/docs/guides/topic-detail/module-federation/_meta.json +1 -0
- package/docs/guides/topic-detail/module-federation/application.mdx +116 -0
- package/docs/guides/topic-detail/module-federation/deploy.mdx +104 -0
- package/docs/guides/topic-detail/module-federation/i18n.mdx +670 -0
- package/docs/guides/topic-detail/module-federation/introduce.mdx +36 -0
- package/docs/guides/topic-detail/module-federation/ssr.mdx +177 -0
- package/docs/guides/topic-detail/module-federation/usage.mdx +202 -0
- package/docs/guides/troubleshooting/_meta.json +1 -0
- package/docs/guides/troubleshooting/builder.mdx +114 -0
- package/docs/guides/troubleshooting/cli.mdx +39 -0
- package/docs/guides/troubleshooting/dependencies.mdx +123 -0
- package/docs/guides/troubleshooting/hmr.mdx +148 -0
- package/docs/guides/upgrade/_meta.json +1 -0
- package/docs/guides/upgrade/config.mdx +951 -0
- package/docs/guides/upgrade/entry.mdx +463 -0
- package/docs/guides/upgrade/other.mdx +183 -0
- package/docs/guides/upgrade/overview.mdx +33 -0
- package/docs/guides/upgrade/tailwindcss.mdx +92 -0
- package/docs/guides/upgrade/web-server.md +109 -0
- package/docs/index.md +4 -0
- package/package.json +43 -20
- package/scripts/copy-main-doc.mjs +50 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ssg
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# output.ssg
|
|
6
|
+
|
|
7
|
+
- **Type:** `boolean | object`
|
|
8
|
+
- **Default Value:** `undefined`
|
|
9
|
+
|
|
10
|
+
Configuration to enable the application’s SSG (Static Site Generation) feature.
|
|
11
|
+
|
|
12
|
+
:::tip Enabling SSG
|
|
13
|
+
This configuration takes effect only when SSG is enabled. Please read the [Static Site Generation](/guides/basic-features/render/ssg) documentation to understand how to enable SSG and its use cases.
|
|
14
|
+
|
|
15
|
+
:::
|
|
16
|
+
|
|
17
|
+
:::info Recommended Reading
|
|
18
|
+
The SSG feature is closely related to routing. It is recommended to understand the [routing solution](/guides/basic-features/routes/routes) before using SSG.
|
|
19
|
+
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
:::info
|
|
23
|
+
- Use `output.ssg` for single-entry apps.
|
|
24
|
+
- For multi-entry apps, prefer `output.ssgByEntries`.
|
|
25
|
+
- If `output.ssg` is `true` and `output.ssgByEntries` is not set, all routes under all entries are treated as SSG routes.
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
## Boolean Type
|
|
30
|
+
|
|
31
|
+
When this configuration is set to `true`, the SSG feature will be enabled for all entries by default. For **manual routing**, the root route of the entry will be rendered. For **conventional routing**, each route in the entry will be rendered.
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
output: {
|
|
36
|
+
ssg: true,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Object Type
|
|
42
|
+
|
|
43
|
+
When the value type is `Object`, the following attributes can be configured.
|
|
44
|
+
|
|
45
|
+
### Configuration Type
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
type SSGRouteOptions =
|
|
49
|
+
| string
|
|
50
|
+
| {
|
|
51
|
+
url: string;
|
|
52
|
+
headers?: Record<string, any>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type SSGOptions = {
|
|
56
|
+
headers?: Record<string, any>;
|
|
57
|
+
routes?: SSGRouteOptions[];
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Example
|
|
62
|
+
|
|
63
|
+
In the example configuration below, SSG will render the pages corresponding to the `/`, `/about`, and `/user/:id` routes.
|
|
64
|
+
|
|
65
|
+
For the `/user/:id` route, `cookies` will be added to the request headers.
|
|
66
|
+
|
|
67
|
+
```ts title="modern.config.ts"
|
|
68
|
+
export default defineConfig({
|
|
69
|
+
output: {
|
|
70
|
+
ssg: {
|
|
71
|
+
routes: [
|
|
72
|
+
'/',
|
|
73
|
+
'/about',
|
|
74
|
+
{
|
|
75
|
+
url: '/user/modernjs',
|
|
76
|
+
headers: {
|
|
77
|
+
cookies: 'name=modernjs',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ssgByEntries
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# output.ssgByEntries
|
|
6
|
+
|
|
7
|
+
- **Type:** `Record<string, boolean | object>`
|
|
8
|
+
- **Default Value:** `undefined`
|
|
9
|
+
|
|
10
|
+
Configure SSG per entry for multi-entry applications.
|
|
11
|
+
|
|
12
|
+
:::info
|
|
13
|
+
- Use `output.ssg` for single-entry apps.
|
|
14
|
+
- For multi-entry apps, prefer `output.ssgByEntries`.
|
|
15
|
+
- If `output.ssg` is `true` and `output.ssgByEntries` is not set, all routes under all entries are treated as SSG routes.
|
|
16
|
+
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
## Configuration Type
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
type SSGRouteOptions =
|
|
23
|
+
| string
|
|
24
|
+
| {
|
|
25
|
+
url: string;
|
|
26
|
+
headers?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type SSGOptions = {
|
|
30
|
+
headers?: Record<string, any>;
|
|
31
|
+
routes?: SSGRouteOptions[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// ssgByEntries type
|
|
35
|
+
type SSGMultiEntryOptions = Record<string, boolean | SSGOptions>;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
### Enable SSG for some entries
|
|
41
|
+
|
|
42
|
+
```ts title="modern.config.ts"
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
output: {
|
|
45
|
+
ssgByEntries: {
|
|
46
|
+
home: true,
|
|
47
|
+
admin: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Configure routes per entry
|
|
54
|
+
|
|
55
|
+
```ts title="modern.config.ts"
|
|
56
|
+
export default defineConfig({
|
|
57
|
+
output: {
|
|
58
|
+
ssgByEntries: {
|
|
59
|
+
home: {
|
|
60
|
+
routes: ['/', '/about', '/user/modernjs'],
|
|
61
|
+
},
|
|
62
|
+
admin: {
|
|
63
|
+
routes: ['/', '/dashboard'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Configure headers per entry or route
|
|
71
|
+
|
|
72
|
+
```ts title="modern.config.ts"
|
|
73
|
+
export default defineConfig({
|
|
74
|
+
output: {
|
|
75
|
+
ssgByEntries: {
|
|
76
|
+
home: {
|
|
77
|
+
headers: {
|
|
78
|
+
'x-tt-env': 'ppe_modernjs',
|
|
79
|
+
},
|
|
80
|
+
routes: [
|
|
81
|
+
'/',
|
|
82
|
+
{
|
|
83
|
+
url: '/about',
|
|
84
|
+
headers: {
|
|
85
|
+
from: 'modern-website',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: svgDefaultExport
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# output.svgDefaultExport
|
|
6
|
+
|
|
7
|
+
- **Type:** `'url' | 'component'`
|
|
8
|
+
- **Default:** `'url'`
|
|
9
|
+
|
|
10
|
+
`output.svgDefaultExport` is used to configure the default export type of SVG files.
|
|
11
|
+
|
|
12
|
+
When `output.svgDefaultExport` is set to `url` , the default export of SVG files is the URL of the file. For example:
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import logo from './logo.svg';
|
|
16
|
+
|
|
17
|
+
console.log(logo); // => asset url
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
When `output.svgDefaultExport` is set to `component` , the default export of SVG files is the React component of the file. For example:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import Logo from './logo.svg';
|
|
24
|
+
|
|
25
|
+
console.log(Logo); // => React Component
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
At this time, you can also specify the `?url` query to import the URL, for example:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import logo from './logo.svg?url';
|
|
32
|
+
|
|
33
|
+
console.log(logo); // => asset url
|
|
34
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: tempDir
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# output.tempDir
|
|
6
|
+
|
|
7
|
+
- **Type:** `string`
|
|
8
|
+
- **Default:** `''`
|
|
9
|
+
|
|
10
|
+
When developing or building a project, Modern.js generates real Rspack entries and HTML templates, placing them in a temporary directory.
|
|
11
|
+
|
|
12
|
+
If you want to start a project with multiple configurations at the same time, you can use this configuration to generate files in different temporary directories to avoid interference with each other.
|
|
13
|
+
|
|
14
|
+
The configuration can be a relative or absolute path, but paths outside the project should be avoided.
|
|
15
|
+
|
|
16
|
+
Example:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
export default {
|
|
20
|
+
output: {
|
|
21
|
+
tempDir: path.join('node_modules', '.temp-dir'),
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: buildCache
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.buildCache
|
|
6
|
+
|
|
7
|
+
- **Type:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type BuildCacheConfig =
|
|
11
|
+
| {
|
|
12
|
+
/**
|
|
13
|
+
* Base directory for the filesystem cache.
|
|
14
|
+
*/
|
|
15
|
+
cacheDirectory?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Set different cache names based on cacheDigest content.
|
|
18
|
+
*/
|
|
19
|
+
cacheDigest?: Array<string | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* An arrays of additional code dependencies for the build.
|
|
22
|
+
* Rspack will use a hash of each of these items and all dependencies to invalidate the filesystem cache.
|
|
23
|
+
*/
|
|
24
|
+
buildDependencies?: string[];
|
|
25
|
+
}
|
|
26
|
+
| boolean;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Controls the caching behavior during the build process.
|
|
30
|
+
|
|
31
|
+
When persistent Rspack cache is enabled, Modern.js treats `cacheDirectory` as a
|
|
32
|
+
base directory and stores each Rsbuild/Rspack environment in its own child
|
|
33
|
+
directory, such as `client`, `server`, or `workerSSR`. This avoids concurrent
|
|
34
|
+
environment compilers writing to the same filesystem cache root.
|
|
35
|
+
|
|
36
|
+
Modern.js will enable build cache by default to improve the compile speed. You can disable the build cache by setting it to `false`:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
export default {
|
|
40
|
+
performance: {
|
|
41
|
+
buildCache: false,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
47
|
+
|
|
48
|
+
<RsbuildConfig configName="performance.buildCache" />
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: chunkSplit
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.chunkSplit
|
|
6
|
+
|
|
7
|
+
- **Type:** `Object`
|
|
8
|
+
- **Default:** `{ strategy: 'split-by-experience' }`
|
|
9
|
+
|
|
10
|
+
`performance.chunkSplit` is used to configure the chunk splitting strategy. The type of `ChunkSplit` is as follows:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
type ForceSplitting = RegExp[] | Record<string, RegExp>;
|
|
14
|
+
|
|
15
|
+
interface BaseChunkSplit {
|
|
16
|
+
strategy?:
|
|
17
|
+
| 'split-by-module'
|
|
18
|
+
| 'split-by-experience'
|
|
19
|
+
| 'all-in-one'
|
|
20
|
+
| 'single-vendor';
|
|
21
|
+
override?: SplitChunks;
|
|
22
|
+
forceSplitting?: ForceSplitting;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface SplitBySize {
|
|
26
|
+
strategy?: 'split-by-size';
|
|
27
|
+
minSize?: number;
|
|
28
|
+
maxSize?: number;
|
|
29
|
+
override?: SplitChunks;
|
|
30
|
+
forceSplitting?: ForceSplitting;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface SplitCustom {
|
|
34
|
+
strategy?: 'custom';
|
|
35
|
+
splitChunks?: SplitChunks;
|
|
36
|
+
forceSplitting?: ForceSplitting;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ChunkSplit = BaseChunkSplit | SplitBySize | SplitCustom;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
43
|
+
|
|
44
|
+
<RsbuildConfig configName="performance.chunkSplit" />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: dnsPrefetch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.dnsPrefetch
|
|
6
|
+
|
|
7
|
+
- **Type:** `undefined | string[]`
|
|
8
|
+
|
|
9
|
+
- **Default:** `undefined`
|
|
10
|
+
|
|
11
|
+
Specifies that the user agent should preemptively perform DNS resolution for the target resource's origin, refer to [dns-prefetch](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/dns-prefetch).
|
|
12
|
+
|
|
13
|
+
After this property is set, the domain name can be resolved before the resource is requested, reducing request latency and improving loading performance.
|
|
14
|
+
|
|
15
|
+
See [Using dns-prefetch](https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch) for more details.
|
|
16
|
+
|
|
17
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
18
|
+
|
|
19
|
+
<RsbuildConfig configName="performance.dnsPrefetch" />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: preconnect
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.preconnect
|
|
6
|
+
|
|
7
|
+
- **Type:** `undefined | Array<string | PreconnectOption>`
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
interface PreconnectOption {
|
|
11
|
+
href: string;
|
|
12
|
+
crossorigin?: boolean;
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- **Default:** `undefined`
|
|
17
|
+
|
|
18
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
19
|
+
|
|
20
|
+
<RsbuildConfig configName="performance.preconnect" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: prefetch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.prefetch
|
|
6
|
+
|
|
7
|
+
- **Type:** `undefined | true | PrefetchOption`
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type IncludeType = 'async-chunks' | 'initial' | 'all-assets' | 'all-chunks';
|
|
11
|
+
|
|
12
|
+
type Filter = Array<string | RegExp> | ((filename: string) => boolean);
|
|
13
|
+
|
|
14
|
+
interface PrefetchOption {
|
|
15
|
+
type?: IncludeType;
|
|
16
|
+
include?: Filter;
|
|
17
|
+
exclude?: Filter;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **Default:** `undefined`
|
|
22
|
+
|
|
23
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
24
|
+
|
|
25
|
+
<RsbuildConfig configName="performance.prefetch" />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: preload
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.preload
|
|
6
|
+
|
|
7
|
+
- **Type:** `undefined | true | PreloadOption`
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type IncludeType = 'async-chunks' | 'initial' | 'all-assets' | 'all-chunks';
|
|
11
|
+
|
|
12
|
+
type Filter = Array<string | RegExp> | ((filename: string) => boolean);
|
|
13
|
+
|
|
14
|
+
interface PreloadOption {
|
|
15
|
+
type?: IncludeType;
|
|
16
|
+
include?: Filter;
|
|
17
|
+
exclude?: Filter;
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **Default:** `undefined`
|
|
22
|
+
|
|
23
|
+
Inject the [`<link rel="preload">`](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload) tags for the static assets generated by Rsbuild.
|
|
24
|
+
|
|
25
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
26
|
+
|
|
27
|
+
<RsbuildConfig configName="performance.preload" />
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: printFileSize
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.printFileSize
|
|
6
|
+
|
|
7
|
+
- **Type:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type PrintFileSizeOptions =
|
|
11
|
+
| {
|
|
12
|
+
/**
|
|
13
|
+
* whether to print total size
|
|
14
|
+
*/
|
|
15
|
+
total?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* whether to print size of each file
|
|
18
|
+
*/
|
|
19
|
+
detail?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* whether to print gzip-compressed size
|
|
22
|
+
*/
|
|
23
|
+
compressed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
| boolean;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **Default:** `true`
|
|
29
|
+
|
|
30
|
+
Whether to print the file sizes after production build.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
info Production file sizes:
|
|
34
|
+
|
|
35
|
+
File Size Gzipped
|
|
36
|
+
dist/static/js/lib-react.09721b5c.js 152.6 kB 49.0 kB
|
|
37
|
+
dist/html/main/index.html 5.8 kB 2.5 kB
|
|
38
|
+
dist/static/js/main.3568a38e.js 3.5 kB 1.4 kB
|
|
39
|
+
dist/static/css/main.03221f72.css 1.4 kB 741 B
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
43
|
+
|
|
44
|
+
<RsbuildConfig configName="performance.printFileSize" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: profile
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.profile
|
|
6
|
+
|
|
7
|
+
- **Type:** `boolean`
|
|
8
|
+
- **Default:** `false`
|
|
9
|
+
|
|
10
|
+
Whether capture timing information for each module, same as the [profile](https://rspack.rs/config/other-options#profile) config of Rspack.
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="performance.profile" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: removeConsole
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.removeConsole
|
|
6
|
+
|
|
7
|
+
- **Type:** `boolean | ConsoleType[]`
|
|
8
|
+
- **Default:** `false`
|
|
9
|
+
|
|
10
|
+
Whether to remove `console.[methodName]` in production build.
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="performance.removeConsole" />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: removeMomentLocale
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.removeMomentLocale
|
|
6
|
+
|
|
7
|
+
- **Type:** `boolean`
|
|
8
|
+
- **Default:** `false`
|
|
9
|
+
|
|
10
|
+
Whether to remove the locales of [moment.js](https://momentjs.com/).
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="performance.removeMomentLocale" />
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: rsdoctor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.rsdoctor
|
|
6
|
+
|
|
7
|
+
- **Type:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type RsdoctorConfig =
|
|
11
|
+
| boolean
|
|
12
|
+
| {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
disableClientServer?: boolean;
|
|
15
|
+
};
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- **Default:** `undefined`, Rsdoctor is disabled unless this option is configured.
|
|
19
|
+
|
|
20
|
+
Configure Rsdoctor diagnostics in Modern.js build. Set this option to `true` to enable Rsdoctor:
|
|
21
|
+
|
|
22
|
+
```ts title="modern.config.ts"
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
performance: {
|
|
25
|
+
rsdoctor: true,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
You can also use object form. When an object is provided, Rsdoctor is enabled unless `enabled` is set to `false`:
|
|
31
|
+
|
|
32
|
+
```ts title="modern.config.ts"
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
performance: {
|
|
35
|
+
rsdoctor: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
To disable Rsdoctor after enabling it in shared config, set `rsdoctor` to `false` or set `enabled` to `false`.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# plugins
|
|
2
|
+
|
|
3
|
+
- **Type:** `CliPlugin[]`
|
|
4
|
+
- **Default:** `[]`
|
|
5
|
+
|
|
6
|
+
Used to configure custom Modern.js framework CLI plugins. For information on how to create custom CLI plugins, please refer to [How to Write CLI Plugins](/plugin/introduction.html#cli-plugins).
|
|
7
|
+
|
|
8
|
+
## Note
|
|
9
|
+
|
|
10
|
+
This option is **specifically for configuring framework CLI plugins**. If you need to configure other types of plugins, use the appropriate configuration method:
|
|
11
|
+
|
|
12
|
+
- Use [builderPlugins](/configure/app/builder-plugins) for Rsbuild plugins.
|
|
13
|
+
- Use [tools.bundlerChain](/configure/app/tools/bundler-chain) for Rspack plugins.
|
|
14
|
+
- Use the [plugins field in runtime config](/configure/app/runtime/plugins) for framework Runtime plugins.
|
|
15
|
+
|
|
16
|
+
## Examples
|
|
17
|
+
|
|
18
|
+
Below are examples of using CLI plugins:
|
|
19
|
+
|
|
20
|
+
### Using plugins from npm
|
|
21
|
+
|
|
22
|
+
To use plugins from the npm registry, first install the plugins and then import them in your configuration:
|
|
23
|
+
|
|
24
|
+
```ts title="modern.config.ts"
|
|
25
|
+
import { myPlugin } from 'my-plugin';
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
plugins: [myPlugin()],
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Using local plugins
|
|
33
|
+
|
|
34
|
+
To use plugins from your local repository, import them directly using a relative path:
|
|
35
|
+
|
|
36
|
+
```ts title="modern.config.ts"
|
|
37
|
+
import { myPlugin } from './config/plugin/myPlugin';
|
|
38
|
+
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
plugins: [myPlugin()],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Plugin configuration
|
|
45
|
+
|
|
46
|
+
If a plugin provides custom configuration options, pass them as parameters to the plugin function:
|
|
47
|
+
|
|
48
|
+
```ts title="modern.config.ts"
|
|
49
|
+
import { myPlugin } from 'my-plugin';
|
|
50
|
+
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
plugins: [
|
|
53
|
+
myPlugin({
|
|
54
|
+
foo: 1,
|
|
55
|
+
bar: 2,
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: aliasStrategy
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.aliasStrategy
|
|
6
|
+
|
|
7
|
+
- **Type:** `'prefer-tsconfig' | 'prefer-alias'`
|
|
8
|
+
- **Default:** `'prefer-tsconfig'`
|
|
9
|
+
|
|
10
|
+
Set the strategy for path alias resolution, to control the priority relationship between the paths option in `tsconfig.json` and the [resolve.alias](https://v2.rsbuild.rs/config/resolve/alias) option of Rsbuild.
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.aliasStrategy" />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: alias
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.alias
|
|
6
|
+
|
|
7
|
+
- **Type:** `string[]`
|
|
8
|
+
|
|
9
|
+
Create aliases for module paths to simplify import paths or redirect module references.
|
|
10
|
+
|
|
11
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
12
|
+
|
|
13
|
+
<RsbuildConfig configName="resolve.alias" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: conditionNames
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.conditionNames
|
|
6
|
+
|
|
7
|
+
- **Type:** `string[]`
|
|
8
|
+
- **Default:** Same as Rspack's `resolve.conditionNames`
|
|
9
|
+
|
|
10
|
+
Specifies the condition names used to match entry points in the [exports](https://nodejs.org/api/packages.html#packages_exports) of a package.
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.extensions" />
|
|
15
|
+
|
|
16
|
+
:::warning
|
|
17
|
+
Do not enable this configuration option for SSR applications, as it will cause SSR rendering to fail.
|
|
18
|
+
:::
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: dedupe
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.dedupe
|
|
6
|
+
|
|
7
|
+
- **Type:** `string[]`
|
|
8
|
+
|
|
9
|
+
Force Rsbuild to resolve the specified packages from project root, which is useful for deduplicating packages and reducing the bundle size. same as the [resolve.dedupe](https://v2.rsbuild.rs/config/resolve/dedupe) config of Rsbuild.
|
|
10
|
+
|
|
11
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
12
|
+
|
|
13
|
+
<RsbuildConfig configName="resolve.dedupe" />
|