@bleedingdev/modern-js-main-doc 3.2.0-ultramodern.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/builder-doc/docs/en/config/performance/rsdoctor.md +37 -0
- package/builder-doc/docs/zh/config/performance/rsdoctor.md +37 -0
- package/docs/en/_nav.json +36 -0
- package/docs/en/apis/_meta.json +13 -0
- package/docs/en/apis/app/commands.mdx +215 -0
- package/docs/en/apis/app/hooks/_meta.json +28 -0
- package/docs/en/apis/app/hooks/api/lambda.mdx +13 -0
- package/docs/en/apis/app/hooks/config/_meta.json +1 -0
- package/docs/en/apis/app/hooks/config/favicon.mdx +29 -0
- package/docs/en/apis/app/hooks/config/html.mdx +9 -0
- package/docs/en/apis/app/hooks/config/icon.mdx +29 -0
- package/docs/en/apis/app/hooks/config/mock.mdx +7 -0
- package/docs/en/apis/app/hooks/config/public.mdx +30 -0
- package/docs/en/apis/app/hooks/config/upload.mdx +54 -0
- package/docs/en/apis/app/hooks/modern-config.mdx +9 -0
- package/docs/en/apis/app/hooks/server/server.mdx +10 -0
- package/docs/en/apis/app/hooks/shared.mdx +7 -0
- package/docs/en/apis/app/hooks/src/app.mdx +30 -0
- package/docs/en/apis/app/hooks/src/entry.mdx +39 -0
- package/docs/en/apis/app/hooks/src/entry.server.mdx +56 -0
- package/docs/en/apis/app/hooks/src/modern.runtime.mdx +9 -0
- package/docs/en/apis/app/hooks/src/routes.mdx +90 -0
- package/docs/en/apis/app/hooks/src/server.mdx +7 -0
- package/docs/en/apis/app/runtime/_meta.json +32 -0
- package/docs/en/apis/app/runtime/bff/use-backend-context.mdx +30 -0
- package/docs/en/apis/app/runtime/core/create-root.mdx +22 -0
- package/docs/en/apis/app/runtime/core/render.mdx +42 -0
- package/docs/en/apis/app/runtime/core/runtime-context.mdx +160 -0
- package/docs/en/apis/app/runtime/router/router.mdx +288 -0
- package/docs/en/apis/app/runtime/ssr/no-ssr.mdx +38 -0
- package/docs/en/apis/app/runtime/ssr/renderStreaming.mdx +71 -0
- package/docs/en/apis/app/runtime/ssr/renderString.mdx +64 -0
- package/docs/en/apis/app/runtime/ssr/requestHandler.mdx +48 -0
- package/docs/en/apis/app/runtime/utility/css-in-js.mdx +44 -0
- package/docs/en/apis/app/runtime/utility/head.mdx +38 -0
- package/docs/en/apis/app/runtime/utility/loadable.mdx +85 -0
- package/docs/en/community/_meta.json +11 -0
- package/docs/en/community/blog/2022-0708-updates.md +95 -0
- package/docs/en/community/blog/2022-0910-updates.md +80 -0
- package/docs/en/community/blog/_meta.json +7 -0
- package/docs/en/community/blog/overview.md +67 -0
- package/docs/en/community/blog/v2-release-note.mdx +244 -0
- package/docs/en/community/blog/v3-release-note.mdx +628 -0
- package/docs/en/community/contributing-guide.mdx +257 -0
- package/docs/en/community/releases.mdx +31 -0
- package/docs/en/community/showcase.mdx +15 -0
- package/docs/en/community/team.mdx +29 -0
- package/docs/en/components/auto-upgrade.mdx +0 -0
- package/docs/en/components/bff-upload.mdx +97 -0
- package/docs/en/components/build-output.mdx +45 -0
- package/docs/en/components/bundler.mdx +3 -0
- package/docs/en/components/convention-routing-motivation.mdx +0 -0
- package/docs/en/components/debug-app.mdx +15 -0
- package/docs/en/components/default-browserslist.mdx +7 -0
- package/docs/en/components/deploy-command.mdx +14 -0
- package/docs/en/components/deploy.mdx +1 -0
- package/docs/en/components/enable-bff-caution.mdx +3 -0
- package/docs/en/components/enable-bff.mdx +56 -0
- package/docs/en/components/enable-ssg.mdx +49 -0
- package/docs/en/components/entry-mode.mdx +0 -0
- package/docs/en/components/entry-scan-logic.mdx +7 -0
- package/docs/en/components/extend-bff-function.mdx +3 -0
- package/docs/en/components/hono.mdx +120 -0
- package/docs/en/components/init-app.mdx +111 -0
- package/docs/en/components/init-rspack-app.mdx +5 -0
- package/docs/en/components/internal-logger.mdx +25 -0
- package/docs/en/components/internal-metrics.mdx +20 -0
- package/docs/en/components/international/custom-instance-code.mdx +16 -0
- package/docs/en/components/international/init-options-desc.mdx +1 -0
- package/docs/en/components/international/install-command.mdx +10 -0
- package/docs/en/components/international/instance-code.mdx +16 -0
- package/docs/en/components/international/introduce.mdx +5 -0
- package/docs/en/components/international/platform-support.mdx +0 -0
- package/docs/en/components/language-config.mdx +9 -0
- package/docs/en/components/micro-frontend.mdx +6 -0
- package/docs/en/components/micro-master-manifest-config.mdx +15 -0
- package/docs/en/components/micro-runtime-config.mdx +17 -0
- package/docs/en/components/module-federation.mdx +7 -0
- package/docs/en/components/new-entry-tooltip.mdx +0 -0
- package/docs/en/components/nodeVersion.mdx +28 -0
- package/docs/en/components/other-plugins.mdx +0 -0
- package/docs/en/components/output-asset-prefix-extend.mdx +0 -0
- package/docs/en/components/output-distpath-warning.mdx +0 -0
- package/docs/en/components/output-polyfill-extend.mdx +1 -0
- package/docs/en/components/prerequisites.mdx +18 -0
- package/docs/en/components/release-note.mdx +1 -0
- package/docs/en/components/routes-practice.mdx +0 -0
- package/docs/en/components/rsbuild-config-tooltip.mdx +5 -0
- package/docs/en/components/rsbuild.mdx +3 -0
- package/docs/en/components/rsc-deploy-tip.mdx +1 -0
- package/docs/en/components/rspack.mdx +3 -0
- package/docs/en/components/rspackTip.mdx +7 -0
- package/docs/en/components/runtime-cli-config.mdx +0 -0
- package/docs/en/components/serve-command.mdx +22 -0
- package/docs/en/components/ssr-monitor.mdx +3 -0
- package/docs/en/components/stream-ssr-performance.mdx +0 -0
- package/docs/en/components/swc.mdx +3 -0
- package/docs/en/components/tech-stack-node-framework.mdx +1 -0
- package/docs/en/components/turtorials-example-list.mdx +2 -0
- package/docs/en/components/ua-polyfill.mdx +44 -0
- package/docs/en/components/upgrade-browserslist.mdx +0 -0
- package/docs/en/components/upgrade-config-deploy.mdx +0 -0
- package/docs/en/components/upgrade-faq.mdx +0 -0
- package/docs/en/configure/_meta.json +78 -0
- package/docs/en/configure/app/bff/cross-project.mdx +24 -0
- package/docs/en/configure/app/bff/effect.mdx +152 -0
- package/docs/en/configure/app/bff/prefix.mdx +33 -0
- package/docs/en/configure/app/bff/runtime-framework.mdx +28 -0
- package/docs/en/configure/app/builder-plugins.mdx +70 -0
- package/docs/en/configure/app/dev/asset-prefix.mdx +18 -0
- package/docs/en/configure/app/dev/before-start-url.mdx +21 -0
- package/docs/en/configure/app/dev/client.mdx +45 -0
- package/docs/en/configure/app/dev/hmr.mdx +14 -0
- package/docs/en/configure/app/dev/host.mdx +22 -0
- package/docs/en/configure/app/dev/https.mdx +81 -0
- package/docs/en/configure/app/dev/lazy-compilation.mdx +45 -0
- package/docs/en/configure/app/dev/live-reload.mdx +14 -0
- package/docs/en/configure/app/dev/progress-bar.mdx +23 -0
- package/docs/en/configure/app/dev/server.mdx +128 -0
- package/docs/en/configure/app/dev/setup-middlewares.mdx +36 -0
- package/docs/en/configure/app/dev/start-url.mdx +53 -0
- package/docs/en/configure/app/dev/watch-files.mdx +31 -0
- package/docs/en/configure/app/dev/write-to-disk.mdx +14 -0
- package/docs/en/configure/app/experiments/source-build.mdx +33 -0
- package/docs/en/configure/app/html/app-icon.mdx +32 -0
- package/docs/en/configure/app/html/crossorigin.mdx +14 -0
- package/docs/en/configure/app/html/favicon.mdx +20 -0
- package/docs/en/configure/app/html/inject.mdx +14 -0
- package/docs/en/configure/app/html/meta.mdx +28 -0
- package/docs/en/configure/app/html/mount-id.mdx +14 -0
- package/docs/en/configure/app/html/output-structure.mdx +14 -0
- package/docs/en/configure/app/html/script-loading.mdx +14 -0
- package/docs/en/configure/app/html/tags.mdx +19 -0
- package/docs/en/configure/app/html/template-parameters.mdx +37 -0
- package/docs/en/configure/app/html/template.mdx +14 -0
- package/docs/en/configure/app/html/title.mdx +22 -0
- package/docs/en/configure/app/output/asset-prefix.mdx +18 -0
- package/docs/en/configure/app/output/assets-retry.mdx +81 -0
- package/docs/en/configure/app/output/charset.mdx +14 -0
- package/docs/en/configure/app/output/clean-dist-path.mdx +20 -0
- package/docs/en/configure/app/output/convert-to-rem.mdx +83 -0
- package/docs/en/configure/app/output/copy.mdx +14 -0
- package/docs/en/configure/app/output/css-modules.mdx +52 -0
- package/docs/en/configure/app/output/data-uri-limit.mdx +30 -0
- package/docs/en/configure/app/output/disable-css-module-extension.mdx +59 -0
- package/docs/en/configure/app/output/disable-inline-runtime-chunk.mdx +45 -0
- package/docs/en/configure/app/output/disable-svgr.mdx +20 -0
- package/docs/en/configure/app/output/disable-ts-checker.mdx +53 -0
- package/docs/en/configure/app/output/dist-path.mdx +51 -0
- package/docs/en/configure/app/output/enable-asset-manifest.mdx +40 -0
- package/docs/en/configure/app/output/enable-css-module-tsdeclaration.mdx +32 -0
- package/docs/en/configure/app/output/enable-inline-route-manifests.mdx +20 -0
- package/docs/en/configure/app/output/externals.mdx +24 -0
- package/docs/en/configure/app/output/filename-hash.mdx +14 -0
- package/docs/en/configure/app/output/filename.mdx +59 -0
- package/docs/en/configure/app/output/inject-styles.mdx +14 -0
- package/docs/en/configure/app/output/inline-scripts.mdx +33 -0
- package/docs/en/configure/app/output/inline-styles.mdx +33 -0
- package/docs/en/configure/app/output/legal-comments.mdx +22 -0
- package/docs/en/configure/app/output/minify.mdx +26 -0
- package/docs/en/configure/app/output/override-browserslist.mdx +26 -0
- package/docs/en/configure/app/output/polyfill.mdx +18 -0
- package/docs/en/configure/app/output/source-map.mdx +34 -0
- package/docs/en/configure/app/output/split-route-chunks.mdx +20 -0
- package/docs/en/configure/app/output/ssg.mdx +85 -0
- package/docs/en/configure/app/output/ssgByEntries.mdx +93 -0
- package/docs/en/configure/app/output/svg-default-export.mdx +34 -0
- package/docs/en/configure/app/output/temp-dir.mdx +24 -0
- package/docs/en/configure/app/performance/build-cache.mdx +43 -0
- package/docs/en/configure/app/performance/chunk-split.mdx +44 -0
- package/docs/en/configure/app/performance/dns-prefetch.mdx +19 -0
- package/docs/en/configure/app/performance/preconnect.mdx +20 -0
- package/docs/en/configure/app/performance/prefetch.mdx +25 -0
- package/docs/en/configure/app/performance/preload.mdx +27 -0
- package/docs/en/configure/app/performance/print-file-size.mdx +44 -0
- package/docs/en/configure/app/performance/profile.mdx +14 -0
- package/docs/en/configure/app/performance/remove-console.mdx +14 -0
- package/docs/en/configure/app/performance/remove-moment-locale.mdx +14 -0
- package/docs/en/configure/app/performance/rsdoctor.mdx +39 -0
- package/docs/en/configure/app/plugins.mdx +59 -0
- package/docs/en/configure/app/resolve/alias-strategy.mdx +14 -0
- package/docs/en/configure/app/resolve/alias.mdx +13 -0
- package/docs/en/configure/app/resolve/condition-names.mdx +18 -0
- package/docs/en/configure/app/resolve/dedupe.mdx +13 -0
- package/docs/en/configure/app/resolve/extensions.mdx +18 -0
- package/docs/en/configure/app/runtime/0-intro.mdx +61 -0
- package/docs/en/configure/app/runtime/plugins.mdx +58 -0
- package/docs/en/configure/app/runtime/router.mdx +39 -0
- package/docs/en/configure/app/security/check-syntax.mdx +73 -0
- package/docs/en/configure/app/security/nonce.mdx +19 -0
- package/docs/en/configure/app/security/sri.mdx +24 -0
- package/docs/en/configure/app/server/base-url.mdx +30 -0
- package/docs/en/configure/app/server/port.mdx +22 -0
- package/docs/en/configure/app/server/public-routes.mdx +26 -0
- package/docs/en/configure/app/server/routes.mdx +90 -0
- package/docs/en/configure/app/server/rsc.mdx +30 -0
- package/docs/en/configure/app/server/ssr-by-entries.mdx +29 -0
- package/docs/en/configure/app/server/ssr.mdx +85 -0
- package/docs/en/configure/app/server/tsconfig-path.mdx +63 -0
- package/docs/en/configure/app/source/alias-strategy.mdx +18 -0
- package/docs/en/configure/app/source/alias.mdx +27 -0
- package/docs/en/configure/app/source/config-dir.mdx +24 -0
- package/docs/en/configure/app/source/decorators.mdx +29 -0
- package/docs/en/configure/app/source/define.mdx +20 -0
- package/docs/en/configure/app/source/disable-default-entries.mdx +32 -0
- package/docs/en/configure/app/source/enable-async-entry.mdx +54 -0
- package/docs/en/configure/app/source/enable-async-pre-entry.mdx +30 -0
- package/docs/en/configure/app/source/entries-dir.mdx +39 -0
- package/docs/en/configure/app/source/entries.mdx +183 -0
- package/docs/en/configure/app/source/exclude.mdx +14 -0
- package/docs/en/configure/app/source/global-vars.mdx +110 -0
- package/docs/en/configure/app/source/include.mdx +40 -0
- package/docs/en/configure/app/source/main-entry-name.mdx +28 -0
- package/docs/en/configure/app/source/pre-entry.mdx +14 -0
- package/docs/en/configure/app/source/transform-import.mdx +31 -0
- package/docs/en/configure/app/split-chunks.mdx +17 -0
- package/docs/en/configure/app/tools/autoprefixer.mdx +48 -0
- package/docs/en/configure/app/tools/bundler-chain.mdx +30 -0
- package/docs/en/configure/app/tools/css-extract.mdx +37 -0
- package/docs/en/configure/app/tools/css-loader.mdx +21 -0
- package/docs/en/configure/app/tools/dev-server.mdx +117 -0
- package/docs/en/configure/app/tools/html-plugin.mdx +45 -0
- package/docs/en/configure/app/tools/less.mdx +85 -0
- package/docs/en/configure/app/tools/lightningcss-loader.mdx +39 -0
- package/docs/en/configure/app/tools/minify-css.mdx +57 -0
- package/docs/en/configure/app/tools/postcss.mdx +38 -0
- package/docs/en/configure/app/tools/rspack.mdx +14 -0
- package/docs/en/configure/app/tools/sass.mdx +82 -0
- package/docs/en/configure/app/tools/style-loader.mdx +14 -0
- package/docs/en/configure/app/tools/swc.mdx +69 -0
- package/docs/en/configure/app/tools/ts-checker.mdx +56 -0
- package/docs/en/configure/app/usage.mdx +276 -0
- package/docs/en/guides/_meta.json +37 -0
- package/docs/en/guides/advanced-features/_meta.json +32 -0
- package/docs/en/guides/advanced-features/bff/_meta.json +10 -0
- package/docs/en/guides/advanced-features/bff/cross-project.mdx +110 -0
- package/docs/en/guides/advanced-features/bff/data-platform.mdx +118 -0
- package/docs/en/guides/advanced-features/bff/extend-server.mdx +120 -0
- package/docs/en/guides/advanced-features/bff/frameworks.mdx +118 -0
- package/docs/en/guides/advanced-features/bff/function.mdx +261 -0
- package/docs/en/guides/advanced-features/bff/operators.mdx +629 -0
- package/docs/en/guides/advanced-features/bff/sdk.mdx +116 -0
- package/docs/en/guides/advanced-features/bff/upload.mdx +7 -0
- package/docs/en/guides/advanced-features/bff.mdx +22 -0
- package/docs/en/guides/advanced-features/build-performance.mdx +134 -0
- package/docs/en/guides/advanced-features/compatibility.mdx +81 -0
- package/docs/en/guides/advanced-features/international/_meta.json +10 -0
- package/docs/en/guides/advanced-features/international/advanced.mdx +132 -0
- package/docs/en/guides/advanced-features/international/api.mdx +235 -0
- package/docs/en/guides/advanced-features/international/best-practices.mdx +290 -0
- package/docs/en/guides/advanced-features/international/configuration.mdx +221 -0
- package/docs/en/guides/advanced-features/international/locale-detection.mdx +130 -0
- package/docs/en/guides/advanced-features/international/quick-start.mdx +112 -0
- package/docs/en/guides/advanced-features/international/resource-loading.mdx +158 -0
- package/docs/en/guides/advanced-features/international/routing.mdx +134 -0
- package/docs/en/guides/advanced-features/international.mdx +29 -0
- package/docs/en/guides/advanced-features/low-level.mdx +50 -0
- package/docs/en/guides/advanced-features/page-performance/_meta.json +1 -0
- package/docs/en/guides/advanced-features/page-performance/code-split.mdx +81 -0
- package/docs/en/guides/advanced-features/page-performance/inline-assets.mdx +163 -0
- package/docs/en/guides/advanced-features/page-performance/optimize-bundle.mdx +101 -0
- package/docs/en/guides/advanced-features/page-performance/react-compiler.mdx +54 -0
- package/docs/en/guides/advanced-features/server-monitor/_meta.json +1 -0
- package/docs/en/guides/advanced-features/server-monitor/logger.mdx +19 -0
- package/docs/en/guides/advanced-features/server-monitor/metrics.mdx +41 -0
- package/docs/en/guides/advanced-features/server-monitor/monitors.mdx +242 -0
- package/docs/en/guides/advanced-features/source-build.mdx +168 -0
- package/docs/en/guides/advanced-features/web-server.mdx +284 -0
- package/docs/en/guides/basic-features/_meta.json +49 -0
- package/docs/en/guides/basic-features/alias.mdx +106 -0
- package/docs/en/guides/basic-features/css/_meta.json +1 -0
- package/docs/en/guides/basic-features/css/css-in-js.mdx +69 -0
- package/docs/en/guides/basic-features/css/css-modules.mdx +212 -0
- package/docs/en/guides/basic-features/css/css.mdx +31 -0
- package/docs/en/guides/basic-features/css/tailwindcss.mdx +27 -0
- package/docs/en/guides/basic-features/data/_meta.json +1 -0
- package/docs/en/guides/basic-features/data/data-cache.mdx +515 -0
- package/docs/en/guides/basic-features/data/data-fetch.mdx +419 -0
- package/docs/en/guides/basic-features/data/data-write.mdx +230 -0
- package/docs/en/guides/basic-features/debug/_meta.json +1 -0
- package/docs/en/guides/basic-features/debug/mock.mdx +102 -0
- package/docs/en/guides/basic-features/debug/proxy.mdx +25 -0
- package/docs/en/guides/basic-features/debug/rsdoctor.mdx +48 -0
- package/docs/en/guides/basic-features/debug/using-storybook.mdx +100 -0
- package/docs/en/guides/basic-features/deploy.mdx +448 -0
- package/docs/en/guides/basic-features/env-vars.mdx +181 -0
- package/docs/en/guides/basic-features/html.mdx +259 -0
- package/docs/en/guides/basic-features/output-files.mdx +145 -0
- package/docs/en/guides/basic-features/render/_meta.json +10 -0
- package/docs/en/guides/basic-features/render/before-render.mdx +108 -0
- package/docs/en/guides/basic-features/render/overview.mdx +52 -0
- package/docs/en/guides/basic-features/render/rsc.mdx +534 -0
- package/docs/en/guides/basic-features/render/ssg.mdx +167 -0
- package/docs/en/guides/basic-features/render/ssr-cache.mdx +201 -0
- package/docs/en/guides/basic-features/render/ssr.mdx +323 -0
- package/docs/en/guides/basic-features/render/streaming-ssr.mdx +267 -0
- package/docs/en/guides/basic-features/render/tanstack-rsc.mdx +226 -0
- package/docs/en/guides/basic-features/routes/_meta.json +1 -0
- package/docs/en/guides/basic-features/routes/config-routes.mdx +427 -0
- package/docs/en/guides/basic-features/routes/routes.mdx +517 -0
- package/docs/en/guides/basic-features/static-assets/_meta.json +1 -0
- package/docs/en/guides/basic-features/static-assets/json-files.mdx +124 -0
- package/docs/en/guides/basic-features/static-assets/svg-assets.mdx +172 -0
- package/docs/en/guides/basic-features/static-assets/wasm-assets.mdx +66 -0
- package/docs/en/guides/basic-features/static-assets.mdx +164 -0
- package/docs/en/guides/basic-features/testing/_meta.json +1 -0
- package/docs/en/guides/basic-features/testing/cypress.mdx +95 -0
- package/docs/en/guides/basic-features/testing/jest.mdx +148 -0
- package/docs/en/guides/basic-features/testing/playwright.mdx +111 -0
- package/docs/en/guides/basic-features/testing/rstest.mdx +163 -0
- package/docs/en/guides/basic-features/testing/vitest.mdx +100 -0
- package/docs/en/guides/concept/_meta.json +1 -0
- package/docs/en/guides/concept/builder.mdx +60 -0
- package/docs/en/guides/concept/entries.mdx +325 -0
- package/docs/en/guides/concept/server.mdx +35 -0
- package/docs/en/guides/get-started/_meta.json +8 -0
- package/docs/en/guides/get-started/glossary.mdx +63 -0
- package/docs/en/guides/get-started/introduction.mdx +45 -0
- package/docs/en/guides/get-started/quick-start.mdx +92 -0
- package/docs/en/guides/get-started/tech-stack.mdx +91 -0
- package/docs/en/guides/get-started/ultramodern.mdx +98 -0
- package/docs/en/guides/get-started/upgrade.mdx +114 -0
- package/docs/en/guides/topic-detail/_meta.json +8 -0
- package/docs/en/guides/topic-detail/module-federation/_meta.json +1 -0
- package/docs/en/guides/topic-detail/module-federation/application.mdx +116 -0
- package/docs/en/guides/topic-detail/module-federation/deploy.mdx +104 -0
- package/docs/en/guides/topic-detail/module-federation/i18n.mdx +670 -0
- package/docs/en/guides/topic-detail/module-federation/introduce.mdx +36 -0
- package/docs/en/guides/topic-detail/module-federation/ssr.mdx +170 -0
- package/docs/en/guides/topic-detail/module-federation/usage.mdx +202 -0
- package/docs/en/guides/troubleshooting/_meta.json +1 -0
- package/docs/en/guides/troubleshooting/builder.mdx +114 -0
- package/docs/en/guides/troubleshooting/cli.mdx +39 -0
- package/docs/en/guides/troubleshooting/dependencies.mdx +123 -0
- package/docs/en/guides/troubleshooting/hmr.mdx +148 -0
- package/docs/en/guides/upgrade/_meta.json +1 -0
- package/docs/en/guides/upgrade/config.mdx +949 -0
- package/docs/en/guides/upgrade/entry.mdx +463 -0
- package/docs/en/guides/upgrade/other.mdx +183 -0
- package/docs/en/guides/upgrade/overview.mdx +33 -0
- package/docs/en/guides/upgrade/tailwindcss.mdx +92 -0
- package/docs/en/guides/upgrade/web-server.md +109 -0
- package/docs/en/index.md +4 -0
- package/docs/en/plugin/_meta.json +25 -0
- package/docs/en/plugin/cli-plugins/_meta.json +1 -0
- package/docs/en/plugin/cli-plugins/api.mdx +573 -0
- package/docs/en/plugin/cli-plugins/life-cycle.mdx +135 -0
- package/docs/en/plugin/introduction.mdx +153 -0
- package/docs/en/plugin/official/_meta.json +7 -0
- package/docs/en/plugin/official/cli-plugins/_meta.json +1 -0
- package/docs/en/plugin/official/cli-plugins/plugin-bff.mdx +5 -0
- package/docs/en/plugin/official/cli-plugins/plugin-ssg.mdx +5 -0
- package/docs/en/plugin/official/cli-plugins/plugin-styled-components.mdx +5 -0
- package/docs/en/plugin/official/cli-plugins.mdx +4 -0
- package/docs/en/plugin/plugin-system.mdx +244 -0
- package/docs/en/plugin/runtime-plugins/_meta.json +1 -0
- package/docs/en/plugin/runtime-plugins/api.mdx +193 -0
- package/docs/en/plugin/runtime-plugins/life-cycle.mdx +29 -0
- package/docs/en/plugin/server-plugins/_meta.json +1 -0
- package/docs/en/plugin/server-plugins/api.mdx +212 -0
- package/docs/en/plugin/server-plugins/life-cycle.mdx +43 -0
- package/docs/en/tutorials/_meta.json +7 -0
- package/docs/en/tutorials/examples/csr-auth.mdx +31 -0
- package/docs/en/tutorials/foundations/introduction.mdx +22 -0
- package/docs/zh/_nav.json +36 -0
- package/docs/zh/apis/_meta.json +13 -0
- package/docs/zh/apis/app/commands.mdx +215 -0
- package/docs/zh/apis/app/hooks/_meta.json +28 -0
- package/docs/zh/apis/app/hooks/api/lambda.mdx +14 -0
- package/docs/zh/apis/app/hooks/config/_meta.json +1 -0
- package/docs/zh/apis/app/hooks/config/favicon.mdx +29 -0
- package/docs/zh/apis/app/hooks/config/html.mdx +9 -0
- package/docs/zh/apis/app/hooks/config/icon.mdx +29 -0
- package/docs/zh/apis/app/hooks/config/mock.mdx +7 -0
- package/docs/zh/apis/app/hooks/config/public.mdx +30 -0
- package/docs/zh/apis/app/hooks/config/upload.mdx +54 -0
- package/docs/zh/apis/app/hooks/modern-config.mdx +9 -0
- package/docs/zh/apis/app/hooks/server/server.mdx +10 -0
- package/docs/zh/apis/app/hooks/shared.mdx +7 -0
- package/docs/zh/apis/app/hooks/src/app.mdx +36 -0
- package/docs/zh/apis/app/hooks/src/entry.mdx +39 -0
- package/docs/zh/apis/app/hooks/src/entry.server.mdx +56 -0
- package/docs/zh/apis/app/hooks/src/modern.runtime.mdx +9 -0
- package/docs/zh/apis/app/hooks/src/routes.mdx +90 -0
- package/docs/zh/apis/app/hooks/src/server.mdx +7 -0
- package/docs/zh/apis/app/runtime/_meta.json +32 -0
- package/docs/zh/apis/app/runtime/bff/use-backend-context.mdx +31 -0
- package/docs/zh/apis/app/runtime/core/create-root.mdx +22 -0
- package/docs/zh/apis/app/runtime/core/render.mdx +43 -0
- package/docs/zh/apis/app/runtime/core/runtime-context.mdx +160 -0
- package/docs/zh/apis/app/runtime/router/router.mdx +287 -0
- package/docs/zh/apis/app/runtime/ssr/no-ssr.mdx +38 -0
- package/docs/zh/apis/app/runtime/ssr/renderStreaming.mdx +71 -0
- package/docs/zh/apis/app/runtime/ssr/renderString.mdx +64 -0
- package/docs/zh/apis/app/runtime/ssr/requestHandler.mdx +48 -0
- package/docs/zh/apis/app/runtime/utility/css-in-js.mdx +44 -0
- package/docs/zh/apis/app/runtime/utility/head.mdx +38 -0
- package/docs/zh/apis/app/runtime/utility/loadable.mdx +83 -0
- package/docs/zh/community/_meta.json +11 -0
- package/docs/zh/community/blog/2022-0708-updates.md +95 -0
- package/docs/zh/community/blog/2022-0910-updates.md +80 -0
- package/docs/zh/community/blog/_meta.json +7 -0
- package/docs/zh/community/blog/overview.md +74 -0
- package/docs/zh/community/blog/v2-release-note.mdx +244 -0
- package/docs/zh/community/blog/v3-release-note.mdx +628 -0
- package/docs/zh/community/contributing-guide.mdx +256 -0
- package/docs/zh/community/releases.mdx +31 -0
- package/docs/zh/community/showcase.mdx +15 -0
- package/docs/zh/community/team.mdx +29 -0
- package/docs/zh/components/auto-upgrade.mdx +0 -0
- package/docs/zh/components/bff-operator-code.mdx +5 -0
- package/docs/zh/components/bff-upload.mdx +98 -0
- package/docs/zh/components/build-output.mdx +45 -0
- package/docs/zh/components/bundler.mdx +3 -0
- package/docs/zh/components/convention-routing-motivation.mdx +0 -0
- package/docs/zh/components/debug-app.mdx +16 -0
- package/docs/zh/components/default-browserslist.mdx +7 -0
- package/docs/zh/components/deploy-command.mdx +14 -0
- package/docs/zh/components/deploy.mdx +1 -0
- package/docs/zh/components/enable-bff-caution.mdx +4 -0
- package/docs/zh/components/enable-bff.mdx +56 -0
- package/docs/zh/components/enable-ssg.mdx +49 -0
- package/docs/zh/components/entry-mode.mdx +0 -0
- package/docs/zh/components/entry-scan-logic.mdx +7 -0
- package/docs/zh/components/extend-bff-function.mdx +3 -0
- package/docs/zh/components/hono.mdx +120 -0
- package/docs/zh/components/init-app.mdx +111 -0
- package/docs/zh/components/init-rspack-app.mdx +5 -0
- package/docs/zh/components/internal-logger.mdx +25 -0
- package/docs/zh/components/internal-metrics.mdx +20 -0
- package/docs/zh/components/international/custom-instance-code.mdx +16 -0
- package/docs/zh/components/international/init-options-desc.mdx +1 -0
- package/docs/zh/components/international/install-command.mdx +11 -0
- package/docs/zh/components/international/instance-code.mdx +16 -0
- package/docs/zh/components/international/introduce.mdx +5 -0
- package/docs/zh/components/international/platform-support.mdx +0 -0
- package/docs/zh/components/language-config.mdx +9 -0
- package/docs/zh/components/micro-frontend.mdx +6 -0
- package/docs/zh/components/micro-master-manifest-config.mdx +15 -0
- package/docs/zh/components/micro-runtime-config.mdx +17 -0
- package/docs/zh/components/module-federation.mdx +7 -0
- package/docs/zh/components/new-entry-tooltip.mdx +0 -0
- package/docs/zh/components/nodeVersion.mdx +28 -0
- package/docs/zh/components/other-plugins.mdx +0 -0
- package/docs/zh/components/output-asset-prefix-extend.mdx +0 -0
- package/docs/zh/components/output-distpath-warning.mdx +0 -0
- package/docs/zh/components/output-polyfill-extend.mdx +1 -0
- package/docs/zh/components/prerequisites.mdx +18 -0
- package/docs/zh/components/release-note.mdx +1 -0
- package/docs/zh/components/routes-practice.mdx +0 -0
- package/docs/zh/components/rsbuild-config-tooltip.mdx +5 -0
- package/docs/zh/components/rsbuild.mdx +3 -0
- package/docs/zh/components/rsc-deploy-tip.mdx +1 -0
- package/docs/zh/components/rspack.mdx +3 -0
- package/docs/zh/components/rspackTip.mdx +7 -0
- package/docs/zh/components/runtime-cli-config.mdx +0 -0
- package/docs/zh/components/self-route-example.mdx +21 -0
- package/docs/zh/components/serve-command.mdx +22 -0
- package/docs/zh/components/ssr-monitor.mdx +3 -0
- package/docs/zh/components/stream-ssr-performance.mdx +0 -0
- package/docs/zh/components/swc.mdx +3 -0
- package/docs/zh/components/tech-stack-node-framework.mdx +1 -0
- package/docs/zh/components/turtorials-example-list.mdx +2 -0
- package/docs/zh/components/ua-polyfill.mdx +44 -0
- package/docs/zh/components/upgrade-browserslist.mdx +0 -0
- package/docs/zh/components/upgrade-config-deploy.mdx +0 -0
- package/docs/zh/components/upgrade-faq.mdx +0 -0
- package/docs/zh/configure/_meta.json +78 -0
- package/docs/zh/configure/app/bff/cross-project.mdx +24 -0
- package/docs/zh/configure/app/bff/effect.mdx +152 -0
- package/docs/zh/configure/app/bff/prefix.mdx +33 -0
- package/docs/zh/configure/app/bff/runtime-framework.mdx +28 -0
- package/docs/zh/configure/app/builder-plugins.mdx +72 -0
- package/docs/zh/configure/app/dev/asset-prefix.mdx +18 -0
- package/docs/zh/configure/app/dev/before-start-url.mdx +21 -0
- package/docs/zh/configure/app/dev/client.mdx +45 -0
- package/docs/zh/configure/app/dev/hmr.mdx +14 -0
- package/docs/zh/configure/app/dev/host.mdx +22 -0
- package/docs/zh/configure/app/dev/https.mdx +82 -0
- package/docs/zh/configure/app/dev/lazy-compilation.mdx +44 -0
- package/docs/zh/configure/app/dev/live-reload.mdx +14 -0
- package/docs/zh/configure/app/dev/progress-bar.mdx +23 -0
- package/docs/zh/configure/app/dev/server.mdx +128 -0
- package/docs/zh/configure/app/dev/setup-middlewares.mdx +36 -0
- package/docs/zh/configure/app/dev/start-url.mdx +54 -0
- package/docs/zh/configure/app/dev/watch-files.mdx +31 -0
- package/docs/zh/configure/app/dev/write-to-disk.mdx +14 -0
- package/docs/zh/configure/app/experiments/source-build.mdx +35 -0
- package/docs/zh/configure/app/html/app-icon.mdx +32 -0
- package/docs/zh/configure/app/html/crossorigin.mdx +15 -0
- package/docs/zh/configure/app/html/favicon.mdx +21 -0
- package/docs/zh/configure/app/html/inject.mdx +14 -0
- package/docs/zh/configure/app/html/meta.mdx +28 -0
- package/docs/zh/configure/app/html/mount-id.mdx +14 -0
- package/docs/zh/configure/app/html/output-structure.mdx +14 -0
- package/docs/zh/configure/app/html/script-loading.mdx +14 -0
- package/docs/zh/configure/app/html/tags.mdx +19 -0
- package/docs/zh/configure/app/html/template-parameters.mdx +37 -0
- package/docs/zh/configure/app/html/template.mdx +14 -0
- package/docs/zh/configure/app/html/title.mdx +22 -0
- package/docs/zh/configure/app/output/asset-prefix.mdx +18 -0
- package/docs/zh/configure/app/output/assets-retry.mdx +81 -0
- package/docs/zh/configure/app/output/charset.mdx +14 -0
- package/docs/zh/configure/app/output/clean-dist-path.mdx +20 -0
- package/docs/zh/configure/app/output/convert-to-rem.mdx +84 -0
- package/docs/zh/configure/app/output/copy.mdx +14 -0
- package/docs/zh/configure/app/output/css-modules.mdx +52 -0
- package/docs/zh/configure/app/output/data-uri-limit.mdx +30 -0
- package/docs/zh/configure/app/output/disable-css-module-extension.mdx +59 -0
- package/docs/zh/configure/app/output/disable-inline-runtime-chunk.mdx +45 -0
- package/docs/zh/configure/app/output/disable-svgr.mdx +21 -0
- package/docs/zh/configure/app/output/disable-ts-checker.mdx +53 -0
- package/docs/zh/configure/app/output/dist-path.mdx +50 -0
- package/docs/zh/configure/app/output/enable-asset-manifest.mdx +40 -0
- package/docs/zh/configure/app/output/enable-css-module-tsdeclaration.mdx +32 -0
- package/docs/zh/configure/app/output/enable-inline-route-manifests.mdx +21 -0
- package/docs/zh/configure/app/output/externals.mdx +24 -0
- package/docs/zh/configure/app/output/filename-hash.mdx +14 -0
- package/docs/zh/configure/app/output/filename.mdx +62 -0
- package/docs/zh/configure/app/output/inject-styles.mdx +14 -0
- package/docs/zh/configure/app/output/inline-scripts.mdx +33 -0
- package/docs/zh/configure/app/output/inline-styles.mdx +33 -0
- package/docs/zh/configure/app/output/legal-comments.mdx +22 -0
- package/docs/zh/configure/app/output/minify.mdx +26 -0
- package/docs/zh/configure/app/output/override-browserslist.mdx +26 -0
- package/docs/zh/configure/app/output/polyfill.mdx +18 -0
- package/docs/zh/configure/app/output/source-map.mdx +38 -0
- package/docs/zh/configure/app/output/split-route-chunks.mdx +20 -0
- package/docs/zh/configure/app/output/ssg.mdx +84 -0
- package/docs/zh/configure/app/output/ssgByEntries.mdx +94 -0
- package/docs/zh/configure/app/output/svg-default-export.mdx +34 -0
- package/docs/zh/configure/app/output/temp-dir.mdx +22 -0
- package/docs/zh/configure/app/performance/build-cache.mdx +43 -0
- package/docs/zh/configure/app/performance/chunk-split.mdx +44 -0
- package/docs/zh/configure/app/performance/dns-prefetch.mdx +19 -0
- package/docs/zh/configure/app/performance/preconnect.mdx +20 -0
- package/docs/zh/configure/app/performance/prefetch.mdx +25 -0
- package/docs/zh/configure/app/performance/preload.mdx +27 -0
- package/docs/zh/configure/app/performance/print-file-size.mdx +44 -0
- package/docs/zh/configure/app/performance/profile.mdx +14 -0
- package/docs/zh/configure/app/performance/remove-console.mdx +14 -0
- package/docs/zh/configure/app/performance/remove-moment-locale.mdx +14 -0
- package/docs/zh/configure/app/performance/rsdoctor.mdx +39 -0
- package/docs/zh/configure/app/plugins.mdx +59 -0
- package/docs/zh/configure/app/resolve/alias-strategy.mdx +14 -0
- package/docs/zh/configure/app/resolve/alias.mdx +13 -0
- package/docs/zh/configure/app/resolve/condition-names.mdx +18 -0
- package/docs/zh/configure/app/resolve/dedupe.mdx +14 -0
- package/docs/zh/configure/app/resolve/extensions.mdx +18 -0
- package/docs/zh/configure/app/runtime/0-intro.mdx +58 -0
- package/docs/zh/configure/app/runtime/plugins.mdx +58 -0
- package/docs/zh/configure/app/runtime/router.mdx +39 -0
- package/docs/zh/configure/app/security/check-syntax.mdx +73 -0
- package/docs/zh/configure/app/security/nonce.mdx +19 -0
- package/docs/zh/configure/app/security/sri.mdx +24 -0
- package/docs/zh/configure/app/server/base-url.mdx +30 -0
- package/docs/zh/configure/app/server/port.mdx +23 -0
- package/docs/zh/configure/app/server/public-routes.mdx +26 -0
- package/docs/zh/configure/app/server/routes.mdx +90 -0
- package/docs/zh/configure/app/server/rsc.mdx +30 -0
- package/docs/zh/configure/app/server/ssr-by-entries.mdx +29 -0
- package/docs/zh/configure/app/server/ssr.mdx +85 -0
- package/docs/zh/configure/app/server/tsconfig-path.mdx +63 -0
- package/docs/zh/configure/app/source/alias-strategy.mdx +18 -0
- package/docs/zh/configure/app/source/alias.mdx +27 -0
- package/docs/zh/configure/app/source/config-dir.mdx +24 -0
- package/docs/zh/configure/app/source/decorators.mdx +27 -0
- package/docs/zh/configure/app/source/define.mdx +20 -0
- package/docs/zh/configure/app/source/disable-default-entries.mdx +32 -0
- package/docs/zh/configure/app/source/enable-async-entry.mdx +54 -0
- package/docs/zh/configure/app/source/enable-async-pre-entry.mdx +77 -0
- package/docs/zh/configure/app/source/entries-dir.mdx +39 -0
- package/docs/zh/configure/app/source/entries.mdx +185 -0
- package/docs/zh/configure/app/source/exclude.mdx +14 -0
- package/docs/zh/configure/app/source/global-vars.mdx +109 -0
- package/docs/zh/configure/app/source/include.mdx +40 -0
- package/docs/zh/configure/app/source/main-entry-name.mdx +28 -0
- package/docs/zh/configure/app/source/pre-entry.mdx +14 -0
- package/docs/zh/configure/app/source/transform-import.mdx +31 -0
- package/docs/zh/configure/app/split-chunks.mdx +17 -0
- package/docs/zh/configure/app/tools/autoprefixer.mdx +48 -0
- package/docs/zh/configure/app/tools/bundler-chain.mdx +33 -0
- package/docs/zh/configure/app/tools/css-extract.mdx +34 -0
- package/docs/zh/configure/app/tools/css-loader.mdx +21 -0
- package/docs/zh/configure/app/tools/dev-server.mdx +117 -0
- package/docs/zh/configure/app/tools/html-plugin.mdx +45 -0
- package/docs/zh/configure/app/tools/less.mdx +86 -0
- package/docs/zh/configure/app/tools/lightningcss-loader.mdx +39 -0
- package/docs/zh/configure/app/tools/minify-css.mdx +57 -0
- package/docs/zh/configure/app/tools/postcss.mdx +39 -0
- package/docs/zh/configure/app/tools/rspack.mdx +14 -0
- package/docs/zh/configure/app/tools/sass.mdx +80 -0
- package/docs/zh/configure/app/tools/style-loader.mdx +14 -0
- package/docs/zh/configure/app/tools/swc.mdx +69 -0
- package/docs/zh/configure/app/tools/ts-checker.mdx +56 -0
- package/docs/zh/configure/app/usage.mdx +276 -0
- package/docs/zh/guides/_meta.json +37 -0
- package/docs/zh/guides/advanced-features/_meta.json +32 -0
- package/docs/zh/guides/advanced-features/bff/_meta.json +10 -0
- package/docs/zh/guides/advanced-features/bff/cross-project.mdx +112 -0
- package/docs/zh/guides/advanced-features/bff/data-platform.mdx +118 -0
- package/docs/zh/guides/advanced-features/bff/extend-server.mdx +125 -0
- package/docs/zh/guides/advanced-features/bff/frameworks.mdx +118 -0
- package/docs/zh/guides/advanced-features/bff/function.mdx +262 -0
- package/docs/zh/guides/advanced-features/bff/operators.mdx +629 -0
- package/docs/zh/guides/advanced-features/bff/sdk.mdx +117 -0
- package/docs/zh/guides/advanced-features/bff/upload.mdx +7 -0
- package/docs/zh/guides/advanced-features/bff.mdx +21 -0
- package/docs/zh/guides/advanced-features/build-performance.mdx +134 -0
- package/docs/zh/guides/advanced-features/compatibility.mdx +80 -0
- package/docs/zh/guides/advanced-features/international/_meta.json +10 -0
- package/docs/zh/guides/advanced-features/international/advanced.mdx +132 -0
- package/docs/zh/guides/advanced-features/international/api.mdx +234 -0
- package/docs/zh/guides/advanced-features/international/best-practices.mdx +290 -0
- package/docs/zh/guides/advanced-features/international/configuration.mdx +219 -0
- package/docs/zh/guides/advanced-features/international/locale-detection.mdx +130 -0
- package/docs/zh/guides/advanced-features/international/quick-start.mdx +112 -0
- package/docs/zh/guides/advanced-features/international/resource-loading.mdx +155 -0
- package/docs/zh/guides/advanced-features/international/routing.mdx +134 -0
- package/docs/zh/guides/advanced-features/international.mdx +29 -0
- package/docs/zh/guides/advanced-features/low-level.mdx +48 -0
- package/docs/zh/guides/advanced-features/page-performance/_meta.json +1 -0
- package/docs/zh/guides/advanced-features/page-performance/code-split.mdx +81 -0
- package/docs/zh/guides/advanced-features/page-performance/inline-assets.mdx +162 -0
- package/docs/zh/guides/advanced-features/page-performance/optimize-bundle.mdx +101 -0
- package/docs/zh/guides/advanced-features/page-performance/react-compiler.mdx +54 -0
- package/docs/zh/guides/advanced-features/server-monitor/_meta.json +1 -0
- package/docs/zh/guides/advanced-features/server-monitor/logger.mdx +21 -0
- package/docs/zh/guides/advanced-features/server-monitor/metrics.mdx +42 -0
- package/docs/zh/guides/advanced-features/server-monitor/monitors.mdx +240 -0
- package/docs/zh/guides/advanced-features/source-build.mdx +168 -0
- package/docs/zh/guides/advanced-features/web-server.mdx +281 -0
- package/docs/zh/guides/basic-features/_meta.json +49 -0
- package/docs/zh/guides/basic-features/alias.mdx +100 -0
- package/docs/zh/guides/basic-features/css/_meta.json +1 -0
- package/docs/zh/guides/basic-features/css/css-in-js.mdx +69 -0
- package/docs/zh/guides/basic-features/css/css-modules.mdx +218 -0
- package/docs/zh/guides/basic-features/css/css.mdx +31 -0
- package/docs/zh/guides/basic-features/css/tailwindcss.mdx +27 -0
- package/docs/zh/guides/basic-features/data/_meta.json +1 -0
- package/docs/zh/guides/basic-features/data/data-cache.mdx +498 -0
- package/docs/zh/guides/basic-features/data/data-fetch.mdx +421 -0
- package/docs/zh/guides/basic-features/data/data-write.mdx +234 -0
- package/docs/zh/guides/basic-features/debug/_meta.json +1 -0
- package/docs/zh/guides/basic-features/debug/mock.mdx +102 -0
- package/docs/zh/guides/basic-features/debug/proxy.mdx +25 -0
- package/docs/zh/guides/basic-features/debug/rsdoctor.mdx +48 -0
- package/docs/zh/guides/basic-features/debug/using-storybook.mdx +92 -0
- package/docs/zh/guides/basic-features/deploy.mdx +432 -0
- package/docs/zh/guides/basic-features/env-vars.mdx +180 -0
- package/docs/zh/guides/basic-features/html.mdx +262 -0
- package/docs/zh/guides/basic-features/output-files.mdx +145 -0
- package/docs/zh/guides/basic-features/render/_meta.json +10 -0
- package/docs/zh/guides/basic-features/render/before-render.mdx +108 -0
- package/docs/zh/guides/basic-features/render/overview.mdx +53 -0
- package/docs/zh/guides/basic-features/render/rsc.mdx +619 -0
- package/docs/zh/guides/basic-features/render/ssg.mdx +168 -0
- package/docs/zh/guides/basic-features/render/ssr-cache.mdx +205 -0
- package/docs/zh/guides/basic-features/render/ssr.mdx +334 -0
- package/docs/zh/guides/basic-features/render/streaming-ssr.mdx +276 -0
- package/docs/zh/guides/basic-features/render/tanstack-rsc.mdx +226 -0
- package/docs/zh/guides/basic-features/routes/_meta.json +1 -0
- package/docs/zh/guides/basic-features/routes/config-routes.mdx +426 -0
- package/docs/zh/guides/basic-features/routes/routes.mdx +521 -0
- package/docs/zh/guides/basic-features/static-assets/_meta.json +1 -0
- package/docs/zh/guides/basic-features/static-assets/json-files.mdx +124 -0
- package/docs/zh/guides/basic-features/static-assets/svg-assets.mdx +174 -0
- package/docs/zh/guides/basic-features/static-assets/wasm-assets.mdx +66 -0
- package/docs/zh/guides/basic-features/static-assets.mdx +160 -0
- package/docs/zh/guides/basic-features/testing/_meta.json +1 -0
- package/docs/zh/guides/basic-features/testing/cypress.mdx +95 -0
- package/docs/zh/guides/basic-features/testing/jest.mdx +148 -0
- package/docs/zh/guides/basic-features/testing/playwright.mdx +112 -0
- package/docs/zh/guides/basic-features/testing/rstest.mdx +163 -0
- package/docs/zh/guides/basic-features/testing/vitest.mdx +100 -0
- package/docs/zh/guides/concept/_meta.json +1 -0
- package/docs/zh/guides/concept/builder.mdx +60 -0
- package/docs/zh/guides/concept/entries.mdx +323 -0
- package/docs/zh/guides/concept/server.mdx +35 -0
- package/docs/zh/guides/get-started/_meta.json +8 -0
- package/docs/zh/guides/get-started/glossary.mdx +63 -0
- package/docs/zh/guides/get-started/introduction.mdx +45 -0
- package/docs/zh/guides/get-started/quick-start.mdx +90 -0
- package/docs/zh/guides/get-started/tech-stack.mdx +91 -0
- package/docs/zh/guides/get-started/ultramodern.mdx +80 -0
- package/docs/zh/guides/get-started/upgrade.mdx +114 -0
- package/docs/zh/guides/topic-detail/_meta.json +8 -0
- package/docs/zh/guides/topic-detail/module-federation/_meta.json +1 -0
- package/docs/zh/guides/topic-detail/module-federation/application.mdx +117 -0
- package/docs/zh/guides/topic-detail/module-federation/deploy.mdx +104 -0
- package/docs/zh/guides/topic-detail/module-federation/i18n.mdx +623 -0
- package/docs/zh/guides/topic-detail/module-federation/introduce.mdx +35 -0
- package/docs/zh/guides/topic-detail/module-federation/ssr.mdx +168 -0
- package/docs/zh/guides/topic-detail/module-federation/usage.mdx +200 -0
- package/docs/zh/guides/troubleshooting/_meta.json +1 -0
- package/docs/zh/guides/troubleshooting/builder.mdx +134 -0
- package/docs/zh/guides/troubleshooting/cli.mdx +39 -0
- package/docs/zh/guides/troubleshooting/dependencies.mdx +123 -0
- package/docs/zh/guides/troubleshooting/hmr.mdx +148 -0
- package/docs/zh/guides/upgrade/_meta.json +1 -0
- package/docs/zh/guides/upgrade/config.mdx +953 -0
- package/docs/zh/guides/upgrade/entry.mdx +463 -0
- package/docs/zh/guides/upgrade/other.md +190 -0
- package/docs/zh/guides/upgrade/overview.mdx +36 -0
- package/docs/zh/guides/upgrade/tailwindcss.mdx +92 -0
- package/docs/zh/guides/upgrade/web-server.md +111 -0
- package/docs/zh/index.md +4 -0
- package/docs/zh/plugin/_meta.json +25 -0
- package/docs/zh/plugin/cli-plugins/_meta.json +1 -0
- package/docs/zh/plugin/cli-plugins/api.mdx +569 -0
- package/docs/zh/plugin/cli-plugins/life-cycle.mdx +135 -0
- package/docs/zh/plugin/introduction.mdx +153 -0
- package/docs/zh/plugin/official/_meta.json +7 -0
- package/docs/zh/plugin/official/cli-plugins/_meta.json +1 -0
- package/docs/zh/plugin/official/cli-plugins/plugin-bff.mdx +5 -0
- package/docs/zh/plugin/official/cli-plugins/plugin-ssg.mdx +5 -0
- package/docs/zh/plugin/official/cli-plugins/plugin-styled-components.mdx +5 -0
- package/docs/zh/plugin/official/cli-plugins.mdx +4 -0
- package/docs/zh/plugin/plugin-system.mdx +231 -0
- package/docs/zh/plugin/runtime-plugins/_meta.json +1 -0
- package/docs/zh/plugin/runtime-plugins/api.mdx +193 -0
- package/docs/zh/plugin/runtime-plugins/life-cycle.mdx +29 -0
- package/docs/zh/plugin/server-plugins/_meta.json +1 -0
- package/docs/zh/plugin/server-plugins/api.mdx +212 -0
- package/docs/zh/plugin/server-plugins/life-cycle.mdx +43 -0
- package/docs/zh/tutorials/_meta.json +7 -0
- package/docs/zh/tutorials/examples/csr-auth.mdx +31 -0
- package/docs/zh/tutorials/foundations/introduction.mdx +22 -0
- package/i18n.json +142 -0
- package/main-doc/docs/en/guides/get-started/ultramodern.mdx +320 -0
- package/main-doc/docs/zh/guides/get-started/ultramodern.mdx +304 -0
- package/package.json +52 -0
- package/rspress.config.ts +153 -0
- package/src/components/ContentCard/index.module.scss +65 -0
- package/src/components/ContentCard/index.tsx +24 -0
- package/src/components/FeatureLayout/index.module.css +8 -0
- package/src/components/FeatureLayout/index.tsx +8 -0
- package/src/components/Footer/index.tsx +118 -0
- package/src/components/Footer/styles.module.scss +49 -0
- package/src/components/FrameworkCode/index.tsx +605 -0
- package/src/components/ListCard/index.module.css +57 -0
- package/src/components/ListCard/index.tsx +26 -0
- package/src/components/Mermaid/index.tsx +64 -0
- package/src/components/Mermaid/style.scss +221 -0
- package/src/components/RandomMemberList/index.module.scss +35 -0
- package/src/components/RandomMemberList/index.tsx +122 -0
- package/src/components/RsbuildLink/index.tsx +19 -0
- package/src/components/Sandpack/index.css +10 -0
- package/src/components/Sandpack/index.tsx +22 -0
- package/src/components/SecondaryTitle/index.module.css +14 -0
- package/src/components/SecondaryTitle/index.tsx +15 -0
- package/src/components/ShowcaseList/index.module.scss +80 -0
- package/src/components/ShowcaseList/index.tsx +39 -0
- package/src/components/ShowcaseList/useShowcases.ts +101 -0
- package/src/components/SolutionCards/index.module.scss +73 -0
- package/src/components/SolutionCards/index.tsx +30 -0
- package/src/custom.scss +15 -0
- package/src/global.d.ts +28 -0
- package/src/i18n/enUS.ts +54 -0
- package/src/i18n/index.ts +18 -0
- package/src/i18n/zhCN.ts +54 -0
- package/src/index.ts +5 -0
- package/src/pages/index.module.scss +349 -0
- package/src/pages/index.tsx +133 -0
- package/src/sandbox/csr-auth/src/routes/Auth-tsx.txt +74 -0
- package/src/sandbox/csr-auth/src/routes/fakeAuth-ts.txt +16 -0
- package/src/sandbox/csr-auth/src/routes/layout-tsx.txt +21 -0
- package/src/sandbox/csr-auth/src/routes/login/page-tsx.txt +40 -0
- package/src/sandbox/csr-auth/src/routes/page-tsx.txt +17 -0
- package/src/sandbox/csr-auth/src/routes/protected/page-tsx.txt +11 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/features/ai.svg +1 -0
- package/static/img/features/api.svg +1 -0
- package/static/img/features/app.svg +1 -0
- package/static/img/features/blocks.svg +1 -0
- package/static/img/features/browser.svg +12 -0
- package/static/img/features/cloud.svg +1 -0
- package/static/img/features/coding-backend.svg +1 -0
- package/static/img/features/compiler.svg +1 -0
- package/static/img/features/css-file.svg +1 -0
- package/static/img/features/customize.svg +1 -0
- package/static/img/features/developer.svg +1 -0
- package/static/img/features/dynamic.svg +1 -0
- package/static/img/features/editor.svg +1 -0
- package/static/img/features/framework-config.svg +1 -0
- package/static/img/features/framework.svg +1 -0
- package/static/img/features/frameworks.svg +1 -0
- package/static/img/features/html.svg +1 -0
- package/static/img/features/icon2.svg +1 -0
- package/static/img/features/javascript.svg +1 -0
- package/static/img/features/monorepo.svg +1 -0
- package/static/img/features/product.svg +1 -0
- package/static/img/features/server-network.svg +1 -0
- package/static/img/features/serverless.svg +1 -0
- package/static/img/features/test.svg +1 -0
- package/static/img/features/trinity.svg +1 -0
- package/static/img/features/unity.svg +1 -0
- package/static/img/features/url.svg +1 -0
- package/static/img/features/visual.svg +1 -0
- package/static/img/features/web-server.svg +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: removeMomentLocale
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.removeMomentLocale
|
|
6
|
+
|
|
7
|
+
- **类型:** `boolean`
|
|
8
|
+
- **默认值:** `false`
|
|
9
|
+
|
|
10
|
+
是否移除 [moment.js](https://momentjs.com/) 的语言包文件。
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="performance.removeMomentLocale" />
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: rsdoctor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# performance.rsdoctor
|
|
6
|
+
|
|
7
|
+
- **类型:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type RsdoctorConfig =
|
|
11
|
+
| boolean
|
|
12
|
+
| {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- **默认值:** 生产构建时为 `true`,开发模式下为 `false`。
|
|
18
|
+
|
|
19
|
+
用于配置 Modern.js 构建过程中的 Rsdoctor 诊断能力。
|
|
20
|
+
|
|
21
|
+
```ts title="modern.config.ts"
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
performance: {
|
|
24
|
+
rsdoctor: false,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
你也可以使用对象形式:
|
|
30
|
+
|
|
31
|
+
```ts title="modern.config.ts"
|
|
32
|
+
export default defineConfig({
|
|
33
|
+
performance: {
|
|
34
|
+
rsdoctor: {
|
|
35
|
+
enabled: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# plugins
|
|
2
|
+
|
|
3
|
+
- **类型:** `CliPlugin[]`
|
|
4
|
+
- **默认值:** `[]`
|
|
5
|
+
|
|
6
|
+
用于配置自定义的 Modern.js 框架 CLI 插件。自定义 CLI 插件的编写方式请参考 [如何编写 CLI 插件](/plugin/introduction.html#cli-插件)。
|
|
7
|
+
|
|
8
|
+
## 注意事项
|
|
9
|
+
|
|
10
|
+
该选项**用于配置框架 CLI 插件**,如果你需要配置其他类型的插件,请选择对应的配置方式:
|
|
11
|
+
|
|
12
|
+
- 配置 Rsbuild 插件,请使用 [builderPlugins](/configure/app/builder-plugins) 配置项。
|
|
13
|
+
- 配置 Rspack 插件,请使用 [tools.bundlerChain](/configure/app/tools/bundler-chain) 配置项。
|
|
14
|
+
- 配置框架 Runtime 插件,请使用 [runtime 配置文件 plugins](/configure/app/runtime/plugins) 配置项。
|
|
15
|
+
|
|
16
|
+
## 示例
|
|
17
|
+
|
|
18
|
+
下面是 CLI 插件的使用示例。
|
|
19
|
+
|
|
20
|
+
### 使用 npm 上的插件
|
|
21
|
+
|
|
22
|
+
使用 npm 上的插件,需要通过包管理器安装插件,并通过 import 引入。
|
|
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
|
+
### 使用本地插件
|
|
33
|
+
|
|
34
|
+
使用本地代码仓库中的插件,直接通过相对路径 import 引入即可。
|
|
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
|
+
### 插件配置项
|
|
45
|
+
|
|
46
|
+
如果插件提供了一些自定义的配置项,可以通过插件函数的参数传入配置。
|
|
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
|
+
- **类型:** `'prefer-tsconfig' | 'prefer-alias'`
|
|
8
|
+
- **默认值:** `'prefer-tsconfig'`
|
|
9
|
+
|
|
10
|
+
设置路径别名解析的策略,用于控制 `tsconfig.json` 中的 paths 选项与 Rsbuild 的 [resolve.alias](https://v2.rsbuild.rs/config/resolve/alias) 选项之间的优先级关系。
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.aliasStrategy" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: conditionNames
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.conditionNames
|
|
6
|
+
|
|
7
|
+
- **类型:** `string[]`
|
|
8
|
+
- **默认值:** 与 Rsbuild 的 `resolve.conditionNames` 一致
|
|
9
|
+
|
|
10
|
+
指定用于匹配包 [exports](https://nodejs.org/api/packages.html#packages_exports) 字段 入口点的 condition names(条件名称)。
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.extensions" />
|
|
15
|
+
|
|
16
|
+
:::warning
|
|
17
|
+
SSR 应用请勿启用此配置项,否则会导致 SSR 渲染失败。
|
|
18
|
+
:::
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: dedupe
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.dedupe
|
|
6
|
+
|
|
7
|
+
- **类型:** `string[]`
|
|
8
|
+
|
|
9
|
+
强制 Rsbuild 从项目根目录解析指定的包,这可以用于移除重复包和减少包大小。对应 Rsbuild 的 [resolve.dedupe](https://v2.rsbuild.rs/config/resolve/dedupe) 配置。
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.dedupe" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: extensions
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# resolve.extensions
|
|
6
|
+
|
|
7
|
+
- **类型:** `string[]`
|
|
8
|
+
- **默认值:** `['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json']`
|
|
9
|
+
|
|
10
|
+
自动添加导入文件的扩展名。这意味着你可以导入文件,而不需要显式地写它们的扩展名。
|
|
11
|
+
|
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
13
|
+
|
|
14
|
+
<RsbuildConfig configName="resolve.extensions" />
|
|
15
|
+
|
|
16
|
+
:::warning
|
|
17
|
+
SSR 应用请勿启用此配置项,否则会导致 SSR 渲染失败。
|
|
18
|
+
:::
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 介绍
|
|
2
|
+
|
|
3
|
+
Modern.js 的运行时(Runtime)配置需集中在 `src/modern.runtime.ts` 文件中声明。
|
|
4
|
+
|
|
5
|
+
:::info
|
|
6
|
+
如果项目中还没有此文件,请执行以下命令创建:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
touch src/modern.runtime.ts
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
## 基本配置
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
18
|
+
|
|
19
|
+
export default defineRuntimeConfig({
|
|
20
|
+
router: {
|
|
21
|
+
// 路由配置
|
|
22
|
+
},
|
|
23
|
+
// 其他运行时模块...
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 多入口配置
|
|
28
|
+
|
|
29
|
+
对于多入口应用,`defineRuntimeConfig` 函数可以根据入口名称返回特定的配置:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
33
|
+
|
|
34
|
+
export default defineRuntimeConfig(entryName => {
|
|
35
|
+
if (entryName === 'main') {
|
|
36
|
+
return {
|
|
37
|
+
router: {
|
|
38
|
+
// "main" 入口的路由配置
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 其他入口的配置
|
|
44
|
+
return {
|
|
45
|
+
router: {
|
|
46
|
+
// 其他入口的路由配置
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
:::tip
|
|
53
|
+
使用 `src/modern.runtime.ts` 配置方式不支持导出异步函数,这与 Modern.js 的渲染方式有关。如果需要添加异步逻辑,请使用 **[Runtime 插件 (Runtime Plugin)](/plugin/introduction.html#runtime-插件)**。
|
|
54
|
+
:::
|
|
55
|
+
|
|
56
|
+
import RuntimeCliConfig from '@site-docs/components/runtime-cli-config';
|
|
57
|
+
|
|
58
|
+
<RuntimeCliConfig />
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# plugins
|
|
2
|
+
|
|
3
|
+
- **类型:** `RuntimePlugin[]`
|
|
4
|
+
- **默认值:** `[]`
|
|
5
|
+
|
|
6
|
+
用于配置自定义的 Modern.js Runtime 插件。自定义 Runtime 插件的编写方式请参考 [如何编写 Runtime 插件](/plugin/introduction.html#runtime-插件)。
|
|
7
|
+
|
|
8
|
+
:::info
|
|
9
|
+
|
|
10
|
+
Runtime 插件需要在 `src/modern.runtime.ts` 文件中的 plugins 中进行配置。
|
|
11
|
+
|
|
12
|
+
:::
|
|
13
|
+
|
|
14
|
+
## 示例
|
|
15
|
+
|
|
16
|
+
下面是 Runtime 插件的使用示例。
|
|
17
|
+
|
|
18
|
+
### 使用 npm 上的插件
|
|
19
|
+
|
|
20
|
+
使用 npm 上的插件,需要通过包管理器安装插件,并通过 import 引入。
|
|
21
|
+
|
|
22
|
+
```ts title="src/modern.runtime.ts"
|
|
23
|
+
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
24
|
+
import { myPlugin } from 'my-plugin';
|
|
25
|
+
|
|
26
|
+
export default defineRuntimeConfig({
|
|
27
|
+
plugins: [myPlugin()],
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 使用本地插件
|
|
32
|
+
|
|
33
|
+
使用本地代码仓库中的插件,直接通过相对路径 import 引入即可。
|
|
34
|
+
|
|
35
|
+
```ts title="src/modern.runtime.ts"
|
|
36
|
+
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
37
|
+
import { myPlugin } from './config/plugin/myPlugin';
|
|
38
|
+
|
|
39
|
+
export default defineRuntimeConfig({
|
|
40
|
+
plugins: [myPlugin()],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 插件配置项
|
|
45
|
+
|
|
46
|
+
如果插件提供了一些自定义的配置项,可以通过插件函数的参数传入配置。
|
|
47
|
+
|
|
48
|
+
```ts title="src/modern.runtime.ts"
|
|
49
|
+
import { defineRuntimeConfig } from '@modern-js/runtime';
|
|
50
|
+
import { myPlugin } from './config/plugin/myPlugin';
|
|
51
|
+
|
|
52
|
+
export default defineRuntimeConfig({
|
|
53
|
+
plugins: [myPlugin({
|
|
54
|
+
foo: 1,
|
|
55
|
+
bar: 2,
|
|
56
|
+
})],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: router
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# router
|
|
6
|
+
|
|
7
|
+
- **类型:** `Object`
|
|
8
|
+
- **默认值:** `{}`
|
|
9
|
+
|
|
10
|
+
该配置项用于配置客户端路由,支持使用 Modern.js 默认提供的[约定式路由](/guides/concept/entries.html#约定式路由)进行路由管理。
|
|
11
|
+
|
|
12
|
+
:::note
|
|
13
|
+
`router` 配置项**仅在使用约定式路由入口时生效**(即入口中存在 `routes/` 目录)。对于自控式路由入口或自定义入口,该配置不会生效。
|
|
14
|
+
|
|
15
|
+
在多入口应用中,可以通过 `defineRuntimeConfig` 的函数形式为不同入口配置不同的路由行为,详见[运行时配置介绍](/configure/app/runtime/0-intro#多入口配置)。
|
|
16
|
+
:::
|
|
17
|
+
|
|
18
|
+
## basename
|
|
19
|
+
|
|
20
|
+
- **类型:** `string`
|
|
21
|
+
- **默认值:** `/`
|
|
22
|
+
|
|
23
|
+
设置客户端路由的 `basename`,通常用于应用需要部署在域名非根路径下的场景。
|
|
24
|
+
|
|
25
|
+
:::tip
|
|
26
|
+
推荐使用 [`server.baseUrl`](/configure/app/server/base-url) 进行配置。
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
## supportHtml5History
|
|
30
|
+
|
|
31
|
+
- **类型:** `boolean`
|
|
32
|
+
- **默认值:** `true`
|
|
33
|
+
|
|
34
|
+
值为 `true`,使用 `BrowserRouter`;否则使用 `HashRouter`。推荐使用 `BrowserRouter`。
|
|
35
|
+
|
|
36
|
+
:::warning
|
|
37
|
+
当开启 SSR 时,不支持设置 `supportHtml5History`。
|
|
38
|
+
|
|
39
|
+
:::
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: checkSyntax
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# security.checkSyntax
|
|
6
|
+
|
|
7
|
+
- **类型:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type CheckSyntax =
|
|
11
|
+
| boolean
|
|
12
|
+
| {
|
|
13
|
+
targets?: string[];
|
|
14
|
+
exclude?: RegExp | RegExp[];
|
|
15
|
+
ecmaVersion?: EcmaVersion;
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **默认值:** `false`
|
|
20
|
+
|
|
21
|
+
用于分析构建产物中是否存在当前浏览器范围下不兼容的高级语法。如果存在,会将详细信息打印在终端。
|
|
22
|
+
|
|
23
|
+
### 启用检测
|
|
24
|
+
|
|
25
|
+
你可以将 `checkSyntax` 设置为 `true` 来启用语法检测。
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
export default {
|
|
29
|
+
security: {
|
|
30
|
+
checkSyntax: true,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
当你开启 `checkSyntax` 后,Modern.js 会在生产环境构建时进行检测,当在构建产物中检测到不兼容的高级语法后,会将错误日志打印在终端,并退出当前构建流程。
|
|
36
|
+
|
|
37
|
+
### 错误日志
|
|
38
|
+
|
|
39
|
+
错误日志的格式如下所示,包含代码来源文件、产物位置、错误原因、源代码等信息:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
error [Syntax Checker] Find some syntax errors after production build:
|
|
43
|
+
|
|
44
|
+
Error 1
|
|
45
|
+
source: /node_modules/foo/index.js:1:0
|
|
46
|
+
output: /dist/static/js/main.3f7a4d7e.js:2:39400
|
|
47
|
+
reason: Unexpected token (1:178)
|
|
48
|
+
code:
|
|
49
|
+
9 |
|
|
50
|
+
10 | var b = 2;
|
|
51
|
+
11 |
|
|
52
|
+
> 12 | console.log(() => {
|
|
53
|
+
13 | return a + b;
|
|
54
|
+
14 | });
|
|
55
|
+
15 |
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
:::tip
|
|
59
|
+
目前语法检测是基于 AST parser 来实现的,每次检测时,只能找出文件中的第一个不兼容语法。如果一个文件中存在多个不兼容语法,你需要修复已发现的语法,并重新执行检测。
|
|
60
|
+
如果日志中没有显示对应的源码位置,可以尝试将 **output.minify** 设置为 false 后再重新构建。
|
|
61
|
+
:::
|
|
62
|
+
|
|
63
|
+
### 解决方法
|
|
64
|
+
|
|
65
|
+
当检测到语法错误后,你可以通过以下方式来处理:
|
|
66
|
+
|
|
67
|
+
- 如果你希望降级该语法,以保证代码具备良好的兼容性,可以通过 `source.include` 配置来编译相应的模块。
|
|
68
|
+
- 如果你不希望降级该语法,可以调整项目的 browserslist 范围,调整至与该语法相匹配的范围。
|
|
69
|
+
- 如果你不希望对某些产物进行语法检查,可用 `checkSyntax.exclude` 配置排除要检查的文件。
|
|
70
|
+
|
|
71
|
+
### 选项
|
|
72
|
+
|
|
73
|
+
`security.checkSyntax` 底层基于 `@rsbuild/plugin-check-syntax` 实现,具体选项可参考 [@rsbuild/plugin-check-syntax](https://github.com/rspack-contrib/rsbuild-plugin-check-syntax)。
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: nonce
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# security.nonce
|
|
6
|
+
|
|
7
|
+
- **类型:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type Nonce = string;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- **默认值:** `undefined`
|
|
14
|
+
|
|
15
|
+
为 HTML 所引入的脚本资源添加随机属性值 nonce,使浏览器在解析到带有匹配 nonce 值的内联脚本时,能判断该脚本是否能执行。
|
|
16
|
+
|
|
17
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
18
|
+
|
|
19
|
+
<RsbuildConfig configName="security.nonce" />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: sri
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# security.sri
|
|
6
|
+
|
|
7
|
+
- **类型:**
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type SriOptions = {
|
|
11
|
+
hashFuncNames?: [string, ...string[]];
|
|
12
|
+
enabled?: 'auto' | true | false;
|
|
13
|
+
};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- **默认值:** `undefined`
|
|
17
|
+
|
|
18
|
+
为 HTML 所引入的 `<script>` 和 `<link rel="stylesheet">` 标签添加完整性属性 —— `integrity`,使浏览器能够验证引入资源的完整性,以此防止下载的资源被篡改。
|
|
19
|
+
|
|
20
|
+
:::info
|
|
21
|
+
SRI 的具体介绍可以参考 [Rsbuild security.sri](https://v2.rsbuild.rs/zh/config/security/sri)。
|
|
22
|
+
|
|
23
|
+
该配置类型和 Rsbuild 不完全一致,在构建时将自动进行转换。
|
|
24
|
+
:::
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: baseUrl
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# server.baseUrl
|
|
6
|
+
|
|
7
|
+
- **类型:** `string | string[]`
|
|
8
|
+
- **默认值:** `undefined`
|
|
9
|
+
|
|
10
|
+
统一设置服务端路由前缀(常用于多个应用共享同一域名的情况,区分流量)。
|
|
11
|
+
|
|
12
|
+
```ts title="modern.config.ts"
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
server: {
|
|
15
|
+
// 所有生成的路由前面都会自动加上前缀 `/base`
|
|
16
|
+
// 生成的服务端路由文件路径:dist/route.json
|
|
17
|
+
baseUrl: '/base'
|
|
18
|
+
|
|
19
|
+
// 多 baseUrl
|
|
20
|
+
baseUrl: ['/base-new', '/base-old']
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`dev` 之后可以看到路由访问会加上对应前缀:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
> Local: http://localhost:8080/base/
|
|
29
|
+
> Network: http://192.168.0.1:8080/base/
|
|
30
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: port
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# server.port
|
|
6
|
+
|
|
7
|
+
- **类型:** `number`
|
|
8
|
+
- **默认值:** `8080`
|
|
9
|
+
|
|
10
|
+
Modern.js 在执行 `dev` 和 `serve` 命令时,会以 `8080` 为默认端口启动,并会在端口被占用时自动递增端口号。你可以通过该配置来修改 Server 启动的端口号:
|
|
11
|
+
|
|
12
|
+
```ts title="modern.config.ts"
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
server: {
|
|
15
|
+
port: 3000,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
|
21
|
+
|
|
22
|
+
<RsbuildConfig configName="server.port" />
|
|
23
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: publicRoutes
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# server.publicRoutes
|
|
6
|
+
|
|
7
|
+
- **类型:** `Object`
|
|
8
|
+
- **默认值:** 根据文件约定自动生成的服务端路由规则,每个文件生成一条路由规则。
|
|
9
|
+
|
|
10
|
+
该配置选项只作用于服务端路由,可以自定义 `config/public/` 下资源的访问路由。
|
|
11
|
+
|
|
12
|
+
对象的 `key` 为 `config/public/` 的相对文件路径(不使用 `./`), 值可以是 `string`。
|
|
13
|
+
|
|
14
|
+
```ts title="modern.config.ts"
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
server: {
|
|
17
|
+
publicRoutes: {
|
|
18
|
+
// 设置一个长路由
|
|
19
|
+
'index.json': '/user-config/card-info/extra/help.json',
|
|
20
|
+
|
|
21
|
+
// 设置一个不带后缀的路由
|
|
22
|
+
'robot.txt': '/app/authentication',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: routes
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# server.routes
|
|
6
|
+
|
|
7
|
+
- **类型:** `Object`
|
|
8
|
+
- **默认值:** 根据文件约定自动生成的服务端路由规则,每个入口生成一条路由规则,入口名称等于路由路径。
|
|
9
|
+
|
|
10
|
+
该配置选项只作用于服务端路由,可以自定义应用入口的访问路由。
|
|
11
|
+
|
|
12
|
+
## 自定义访问路由
|
|
13
|
+
|
|
14
|
+
对象的 `key` 为当前应用的入口名, 值可以是 `string | Array<string>`。
|
|
15
|
+
|
|
16
|
+
当值类型为 `string` 时,当前值即表示访问该入口的路由名称。
|
|
17
|
+
|
|
18
|
+
```ts title="modern.config.ts"
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
server: {
|
|
21
|
+
routes: {
|
|
22
|
+
// 默认路由为 /entryName1,自定义后为 /p/test1
|
|
23
|
+
entryName1: '/p/test1'
|
|
24
|
+
// 支持动态服务端路由配置
|
|
25
|
+
entryName2: '/detail/:id'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
也可以通过 `Array<string>` 为入口设置多个访问路由:
|
|
32
|
+
|
|
33
|
+
```ts title="modern.config.ts"
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
server: {
|
|
36
|
+
routes: {
|
|
37
|
+
'page-a': [`/a`, '/b'],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
此时,通过 `/a`、`/b` 两个路由都可以访问到 `page-a` 入口。
|
|
44
|
+
|
|
45
|
+
执行 `dev` 命令后,可以在 `dist/route.json` 中查看入口 `page-a` 存在两条路由记录:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"routes": [
|
|
50
|
+
{
|
|
51
|
+
"urlPath": "/a",
|
|
52
|
+
"entryName": "page-a",
|
|
53
|
+
"entryPath": "html/page-a/index.html",
|
|
54
|
+
"isSPA": true,
|
|
55
|
+
"isSSR": false
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"urlPath": "/b",
|
|
59
|
+
"entryName": "page-a",
|
|
60
|
+
"entryPath": "html/page-a/index.html",
|
|
61
|
+
"isSPA": true,
|
|
62
|
+
"isSSR": false
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 自定义响应头
|
|
69
|
+
|
|
70
|
+
可以通过配置入口的 resHeaders 设置响应头:
|
|
71
|
+
|
|
72
|
+
```ts title="modern.config.ts"
|
|
73
|
+
export default defineConfig({
|
|
74
|
+
server: {
|
|
75
|
+
routes: {
|
|
76
|
+
'page-a': {
|
|
77
|
+
route: ['/a', '/b'],
|
|
78
|
+
resHeaders: {
|
|
79
|
+
'x-modern-test': '1',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
:::note
|
|
88
|
+
这一配置在生产环境与开发环境都生效,可以根据 NODE_ENV 区分环境设置不同的响应头。但如果你只需要在开发环境设置响应头,推荐使用 `tools.devServer.headers`。
|
|
89
|
+
|
|
90
|
+
:::
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: rsc
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# server.rsc
|
|
6
|
+
|
|
7
|
+
- **类型:** `boolean`
|
|
8
|
+
- **默认值:** `false`
|
|
9
|
+
|
|
10
|
+
启用 React Server Components (RSC) 配置。
|
|
11
|
+
|
|
12
|
+
当设置为 `true` 时,启用 Modern.js 的 React Server Components 支持。这允许组件在服务端渲染,提供更好的性能和开发体验。
|
|
13
|
+
|
|
14
|
+
```ts title="modern.config.ts"
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
server: {
|
|
17
|
+
rsc: true,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
:::tip 前置条件
|
|
23
|
+
在启用 RSC 之前,请确保:
|
|
24
|
+
1. React 和 React DOM 已升级到 19 版本(建议 19.2.4 以上版本)
|
|
25
|
+
2. 已安装 `react-server-dom-rspack@0.0.1-beta.1` 依赖
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
有关使用 RSC 的更多信息,请参阅 [React Server Components 指南](/guides/basic-features/render/rsc)。
|
|
30
|
+
|