@modern-js/main-doc 2.67.5 → 2.67.7
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/docs/en/apis/app/hooks/server/server.mdx +10 -0
- package/docs/en/apis/app/hooks/src/routes.mdx +3 -73
- package/docs/en/apis/app/runtime/bff/use-hono-context.mdx +30 -0
- package/docs/en/components/enable-bff.mdx +1 -27
- package/docs/en/components/rsbuild-config-tooltip.mdx +2 -2
- package/docs/en/components/tech-stack-node-framework.mdx +1 -1
- package/docs/en/configure/app/dev/asset-prefix.mdx +2 -3
- package/docs/en/configure/app/dev/client.mdx +2 -3
- package/docs/en/configure/app/dev/hmr.mdx +2 -3
- package/docs/en/configure/app/dev/live-reload.mdx +2 -3
- package/docs/en/configure/app/dev/progress-bar.mdx +2 -3
- package/docs/en/configure/app/dev/setup-middlewares.mdx +2 -3
- package/docs/en/configure/app/dev/watch-files.mdx +2 -3
- package/docs/en/configure/app/dev/write-to-disk.mdx +2 -3
- package/docs/en/configure/app/html/app-icon.mdx +2 -3
- package/docs/en/configure/app/html/crossorigin.mdx +2 -3
- package/docs/en/configure/app/html/favicon.mdx +2 -3
- package/docs/en/configure/app/html/inject.mdx +2 -3
- package/docs/en/configure/app/html/meta.mdx +2 -3
- package/docs/en/configure/app/html/mount-id.mdx +2 -3
- package/docs/en/configure/app/html/output-structure.mdx +2 -3
- package/docs/en/configure/app/html/script-loading.mdx +2 -3
- package/docs/en/configure/app/html/tags.mdx +2 -3
- package/docs/en/configure/app/html/template-parameters.mdx +2 -3
- package/docs/en/configure/app/html/template.mdx +2 -3
- package/docs/en/configure/app/html/title.mdx +2 -3
- package/docs/en/configure/app/output/asset-prefix.mdx +2 -3
- package/docs/en/configure/app/output/charset.mdx +2 -3
- package/docs/en/configure/app/output/copy.mdx +2 -3
- package/docs/en/configure/app/output/css-modules.mdx +2 -3
- package/docs/en/configure/app/output/data-uri-limit.mdx +2 -3
- package/docs/en/configure/app/output/dist-path.mdx +2 -4
- package/docs/en/configure/app/output/externals.mdx +2 -3
- package/docs/en/configure/app/output/filename-hash.mdx +2 -3
- package/docs/en/configure/app/output/filename.mdx +2 -3
- package/docs/en/configure/app/output/inject-styles.mdx +2 -3
- package/docs/en/configure/app/output/inline-scripts.mdx +2 -3
- package/docs/en/configure/app/output/inline-styles.mdx +2 -3
- package/docs/en/configure/app/output/legal-comments.mdx +2 -3
- package/docs/en/configure/app/output/minify.mdx +2 -3
- package/docs/en/configure/app/output/override-browserslist.mdx +2 -3
- package/docs/en/configure/app/output/polyfill.mdx +2 -3
- package/docs/en/configure/app/output/source-map.mdx +2 -3
- package/docs/en/configure/app/performance/build-cache.mdx +2 -3
- package/docs/en/configure/app/performance/bundle-analyze.mdx +2 -3
- package/docs/en/configure/app/performance/chunk-split.mdx +2 -3
- package/docs/en/configure/app/performance/dns-prefetch.mdx +2 -3
- package/docs/en/configure/app/performance/preconnect.mdx +2 -3
- package/docs/en/configure/app/performance/prefetch.mdx +2 -3
- package/docs/en/configure/app/performance/preload.mdx +2 -3
- package/docs/en/configure/app/performance/print-file-size.mdx +2 -3
- package/docs/en/configure/app/performance/profile.mdx +2 -3
- package/docs/en/configure/app/performance/remove-console.mdx +2 -3
- package/docs/en/configure/app/performance/remove-moment-locale.mdx +2 -3
- package/docs/en/configure/app/performance/transform-lodash.mdx +4 -1
- package/docs/en/configure/app/security/nonce.mdx +2 -3
- package/docs/en/configure/app/security/sri.mdx +0 -1
- package/docs/en/configure/app/server/port.mdx +2 -3
- package/docs/en/configure/app/source/alias-strategy.mdx +2 -3
- package/docs/en/configure/app/source/alias.mdx +2 -3
- package/docs/en/configure/app/source/decorators.mdx +2 -3
- package/docs/en/configure/app/source/define.mdx +2 -3
- package/docs/en/configure/app/source/exclude.mdx +2 -3
- package/docs/en/configure/app/source/include.mdx +2 -3
- package/docs/en/configure/app/source/module-scopes.mdx +4 -1
- package/docs/en/configure/app/source/pre-entry.mdx +2 -3
- package/docs/en/configure/app/source/transform-import.mdx +2 -3
- package/docs/en/configure/app/tools/css-extract.mdx +2 -3
- package/docs/en/configure/app/tools/css-loader.mdx +2 -2
- package/docs/en/configure/app/tools/html-plugin.mdx +7 -3
- package/docs/en/configure/app/tools/lightningcss-loader.mdx +2 -3
- package/docs/en/configure/app/tools/postcss.mdx +2 -3
- package/docs/en/configure/app/tools/rspack.mdx +2 -3
- package/docs/en/configure/app/tools/style-loader.mdx +2 -3
- package/docs/en/configure/app/tools/swc.mdx +1 -1
- package/docs/en/configure/app/tools/terser.mdx +4 -2
- package/docs/en/configure/app/tools/ts-loader.mdx +4 -1
- package/docs/en/configure/app/tools/webpack-chain.mdx +4 -1
- package/docs/en/configure/app/tools/webpack.mdx +4 -1
- package/docs/en/guides/advanced-features/_meta.json +0 -1
- package/docs/en/guides/advanced-features/bff/extend-server.mdx +33 -82
- package/docs/en/guides/advanced-features/bff/frameworks.mdx +12 -68
- package/docs/en/guides/advanced-features/page-performance/_meta.json +1 -1
- package/docs/en/guides/advanced-features/page-performance/react-compiler.mdx +44 -0
- package/docs/en/guides/advanced-features/web-server.mdx +223 -20
- package/docs/en/guides/basic-features/data/data-cache.mdx +1 -1
- package/docs/en/guides/basic-features/deploy.mdx +3 -3
- package/docs/en/guides/basic-features/output-files.mdx +0 -28
- package/docs/en/guides/basic-features/render/ssr.mdx +1 -1
- package/docs/en/guides/basic-features/render/streaming-ssr.mdx +2 -2
- package/docs/en/guides/basic-features/routes.mdx +72 -0
- package/docs/en/guides/basic-features/static-assets/wasm-assets.mdx +1 -1
- package/docs/en/guides/topic-detail/module-federation/deploy.mdx +83 -7
- package/docs/en/guides/topic-detail/module-federation/usage.mdx +2 -4
- package/docs/en/plugin/cli-plugins/api.mdx +1 -1
- package/docs/en/tutorials/first-app/c04-routes.mdx +4 -2
- package/docs/en/tutorials/first-app/c05-loader.mdx +4 -1
- package/docs/zh/apis/app/hooks/server/server.mdx +10 -0
- package/docs/zh/apis/app/hooks/src/routes.mdx +3 -3
- package/docs/zh/apis/app/runtime/bff/use-hono-context.mdx +31 -0
- package/docs/zh/components/enable-bff.mdx +2 -27
- package/docs/zh/components/rsbuild-config-tooltip.mdx +2 -2
- package/docs/zh/components/tech-stack-node-framework.mdx +1 -1
- package/docs/zh/configure/app/dev/asset-prefix.mdx +2 -3
- package/docs/zh/configure/app/dev/client.mdx +2 -3
- package/docs/zh/configure/app/dev/hmr.mdx +2 -3
- package/docs/zh/configure/app/dev/live-reload.mdx +2 -3
- package/docs/zh/configure/app/dev/progress-bar.mdx +2 -3
- package/docs/zh/configure/app/dev/setup-middlewares.mdx +2 -3
- package/docs/zh/configure/app/dev/watch-files.mdx +2 -3
- package/docs/zh/configure/app/dev/write-to-disk.mdx +2 -3
- package/docs/zh/configure/app/html/app-icon.mdx +2 -3
- package/docs/zh/configure/app/html/crossorigin.mdx +2 -3
- package/docs/zh/configure/app/html/favicon.mdx +2 -3
- package/docs/zh/configure/app/html/inject.mdx +2 -3
- package/docs/zh/configure/app/html/meta.mdx +2 -3
- package/docs/zh/configure/app/html/mount-id.mdx +2 -3
- package/docs/zh/configure/app/html/output-structure.mdx +2 -3
- package/docs/zh/configure/app/html/script-loading.mdx +2 -3
- package/docs/zh/configure/app/html/tags.mdx +2 -3
- package/docs/zh/configure/app/html/template-parameters.mdx +2 -3
- package/docs/zh/configure/app/html/template.mdx +2 -3
- package/docs/zh/configure/app/html/title.mdx +2 -3
- package/docs/zh/configure/app/output/asset-prefix.mdx +2 -3
- package/docs/zh/configure/app/output/charset.mdx +2 -3
- package/docs/zh/configure/app/output/copy.mdx +2 -3
- package/docs/zh/configure/app/output/css-modules.mdx +2 -3
- package/docs/zh/configure/app/output/data-uri-limit.mdx +2 -3
- package/docs/zh/configure/app/output/dist-path.mdx +2 -4
- package/docs/zh/configure/app/output/externals.mdx +2 -3
- package/docs/zh/configure/app/output/filename-hash.mdx +2 -3
- package/docs/zh/configure/app/output/filename.mdx +2 -3
- package/docs/zh/configure/app/output/inject-styles.mdx +2 -3
- package/docs/zh/configure/app/output/inline-scripts.mdx +2 -3
- package/docs/zh/configure/app/output/inline-styles.mdx +2 -3
- package/docs/zh/configure/app/output/legal-comments.mdx +2 -3
- package/docs/zh/configure/app/output/minify.mdx +2 -3
- package/docs/zh/configure/app/output/override-browserslist.mdx +2 -3
- package/docs/zh/configure/app/output/polyfill.mdx +2 -3
- package/docs/zh/configure/app/output/source-map.mdx +2 -3
- package/docs/zh/configure/app/performance/build-cache.mdx +2 -3
- package/docs/zh/configure/app/performance/bundle-analyze.mdx +2 -3
- package/docs/zh/configure/app/performance/chunk-split.mdx +2 -3
- package/docs/zh/configure/app/performance/dns-prefetch.mdx +2 -3
- package/docs/zh/configure/app/performance/preconnect.mdx +2 -3
- package/docs/zh/configure/app/performance/prefetch.mdx +2 -3
- package/docs/zh/configure/app/performance/preload.mdx +2 -3
- package/docs/zh/configure/app/performance/print-file-size.mdx +2 -3
- package/docs/zh/configure/app/performance/profile.mdx +2 -3
- package/docs/zh/configure/app/performance/remove-console.mdx +2 -3
- package/docs/zh/configure/app/performance/remove-moment-locale.mdx +2 -3
- package/docs/zh/configure/app/performance/transform-lodash.mdx +4 -1
- package/docs/zh/configure/app/security/nonce.mdx +2 -3
- package/docs/zh/configure/app/security/sri.mdx +0 -1
- package/docs/zh/configure/app/server/port.mdx +2 -3
- package/docs/zh/configure/app/source/alias-strategy.mdx +2 -3
- package/docs/zh/configure/app/source/alias.mdx +2 -3
- package/docs/zh/configure/app/source/decorators.mdx +2 -3
- package/docs/zh/configure/app/source/define.mdx +2 -3
- package/docs/zh/configure/app/source/exclude.mdx +2 -3
- package/docs/zh/configure/app/source/include.mdx +2 -3
- package/docs/zh/configure/app/source/module-scopes.mdx +4 -1
- package/docs/zh/configure/app/source/pre-entry.mdx +2 -3
- package/docs/zh/configure/app/source/transform-import.mdx +2 -3
- package/docs/zh/configure/app/tools/css-extract.mdx +2 -3
- package/docs/zh/configure/app/tools/css-loader.mdx +2 -3
- package/docs/zh/configure/app/tools/html-plugin.mdx +6 -3
- package/docs/zh/configure/app/tools/lightningcss-loader.mdx +2 -3
- package/docs/zh/configure/app/tools/postcss.mdx +2 -3
- package/docs/zh/configure/app/tools/rspack.mdx +2 -3
- package/docs/zh/configure/app/tools/style-loader.mdx +2 -3
- package/docs/zh/configure/app/tools/swc.mdx +1 -1
- package/docs/zh/configure/app/tools/terser.mdx +4 -2
- package/docs/zh/configure/app/tools/ts-loader.mdx +4 -1
- package/docs/zh/configure/app/tools/webpack-chain.mdx +4 -1
- package/docs/zh/configure/app/tools/webpack.mdx +4 -1
- package/docs/zh/guides/advanced-features/_meta.json +0 -1
- package/docs/zh/guides/advanced-features/bff/extend-server.mdx +28 -76
- package/docs/zh/guides/advanced-features/bff/frameworks.mdx +6 -66
- package/docs/zh/guides/advanced-features/page-performance/_meta.json +1 -1
- package/docs/zh/guides/advanced-features/page-performance/react-compiler.mdx +44 -0
- package/docs/zh/guides/advanced-features/web-server.mdx +221 -24
- package/docs/zh/guides/basic-features/data/data-cache.mdx +1 -1
- package/docs/zh/guides/basic-features/deploy.mdx +4 -3
- package/docs/zh/guides/basic-features/output-files.mdx +0 -28
- package/docs/zh/guides/basic-features/render/ssr.mdx +1 -1
- package/docs/zh/guides/basic-features/render/streaming-ssr.mdx +1 -1
- package/docs/zh/guides/basic-features/static-assets/wasm-assets.mdx +1 -1
- package/docs/zh/guides/topic-detail/module-federation/deploy.mdx +83 -7
- package/docs/zh/guides/topic-detail/module-federation/usage.mdx +2 -4
- package/docs/zh/plugin/cli-plugins/api.mdx +1 -1
- package/docs/zh/tutorials/first-app/c04-routes.mdx +4 -2
- package/docs/zh/tutorials/first-app/c05-loader.mdx +4 -1
- package/package.json +7 -4
- package/rspress.config.ts +16 -1
- package/src/components/RsbuildLink/index.tsx +2 -2
- package/src/index.ts +1 -5
- package/src/pages/index.tsx +3 -3
- package/docs/en/apis/app/hooks/api/middleware.mdx +0 -11
- package/docs/en/apis/app/runtime/bff/hook.mdx +0 -44
- package/docs/en/apis/app/runtime/bff/use-context.mdx +0 -38
- package/docs/en/configure/app/bff/enable-handle-web.mdx +0 -24
- package/docs/en/guides/advanced-features/custom-server.mdx +0 -218
- package/docs/zh/apis/app/hooks/api/middleware.mdx +0 -11
- package/docs/zh/apis/app/runtime/bff/hook.mdx +0 -44
- package/docs/zh/apis/app/runtime/bff/use-context.mdx +0 -38
- package/docs/zh/configure/app/bff/enable-handle-web.mdx +0 -24
- package/docs/zh/guides/advanced-features/custom-server.mdx +0 -216
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: appIcon
|
3
|
-
configName: html.appIcon
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.appIcon
|
@@ -50,6 +49,6 @@ export default {
|
|
50
49
|
};
|
51
50
|
```
|
52
51
|
|
53
|
-
import
|
52
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
54
53
|
|
55
|
-
<
|
54
|
+
<RsbuildConfig configName="html.appIcon" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: crossorigin
|
3
|
-
configName: html.crossorigin
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.crossorigin
|
@@ -11,6 +10,6 @@ configName: html.crossorigin
|
|
11
10
|
用于设置 `<script>` 和 `<style>` 标签的 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性。
|
12
11
|
|
13
12
|
|
14
|
-
import
|
13
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
15
14
|
|
16
|
-
<
|
15
|
+
<RsbuildConfig configName="html.crossorigin" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: favicon
|
3
|
-
configName: html.favicon
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.favicon
|
@@ -17,6 +16,6 @@ configName: html.favicon
|
|
17
16
|
配置该选项后,在编译过程中会自动将图标拷贝至 dist 目录下,并在 HTML 中添加相应的 `link` 标签。
|
18
17
|
|
19
18
|
|
20
|
-
import
|
19
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
21
20
|
|
22
|
-
<
|
21
|
+
<RsbuildConfig configName="html.favicon" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: inject
|
3
|
-
configName: html.inject
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.inject
|
@@ -10,6 +9,6 @@ configName: html.inject
|
|
10
9
|
|
11
10
|
修改构建产物中 `<script>` 标签在 HTML 中的插入位置。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="html.inject" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: meta
|
3
|
-
configName: html.meta
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.meta
|
@@ -24,6 +23,6 @@ const defaultMeta = {
|
|
24
23
|
|
25
24
|
配置 HTML 页面的 `<meta>` 标签。
|
26
25
|
|
27
|
-
import
|
26
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
28
27
|
|
29
|
-
<
|
28
|
+
<RsbuildConfig configName="html.meta" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: mountId
|
3
|
-
configName: html.mountId
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.mountId
|
@@ -10,6 +9,6 @@ configName: html.mountId
|
|
10
9
|
|
11
10
|
默认情况下,HTML 模板中包含了 `root` 节点用于组件挂载,通过 `mountId` 可以修改该节点的 id。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="html.mountId" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: outputStructure
|
3
|
-
configName: html.outputStructure
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.outputStructure
|
@@ -10,6 +9,6 @@ configName: html.outputStructure
|
|
10
9
|
|
11
10
|
用于定义 HTML 产物文件的目录结构。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="html.outputStructure" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: scriptLoading
|
3
|
-
configName: html.scriptLoading
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.scriptLoading
|
@@ -10,6 +9,6 @@ configName: html.scriptLoading
|
|
10
9
|
|
11
10
|
用于设置 `<script>` 标签的加载方式。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="html.scriptLoading" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: tags
|
3
|
-
configName: html.tags
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.tags
|
@@ -15,6 +14,6 @@ type TagsConfig = HtmlTag | HtmlTagHandler | Array<HtmlTag | HtmlTagHandler>;
|
|
15
14
|
|
16
15
|
添加和修改最终注入到 HTML 页面的标签。
|
17
16
|
|
18
|
-
import
|
17
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
19
18
|
|
20
|
-
<
|
19
|
+
<RsbuildConfig configName="html.tags" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: templateParameters
|
3
|
-
configName: html.templateParameters
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.templateParameters
|
@@ -33,6 +32,6 @@ type DefaultParameters = {
|
|
33
32
|
|
34
33
|
定义 HTML 模板中的参数,对应 [html-rspack-plugin](https://github.com/rspack-contrib/html-rspack-plugin) 的 `templateParameters` 配置项。
|
35
34
|
|
36
|
-
import
|
35
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
37
36
|
|
38
|
-
<
|
37
|
+
<RsbuildConfig configName="html.templateParameters" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: template
|
3
|
-
configName: html.template
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.template
|
@@ -10,6 +9,6 @@ configName: html.template
|
|
10
9
|
|
11
10
|
定义 HTML 模板的文件路径,可以是相对路径或绝对路径。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="html.template" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: title
|
3
|
-
configName: html.title
|
4
3
|
---
|
5
4
|
|
6
5
|
# html.title
|
@@ -18,6 +17,6 @@ export default {
|
|
18
17
|
};
|
19
18
|
```
|
20
19
|
|
21
|
-
import
|
20
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
22
21
|
|
23
|
-
<
|
22
|
+
<RsbuildConfig configName="html.title" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: assetPrefix
|
3
|
-
configName: output.assetPrefix
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.assetPrefix
|
@@ -14,6 +13,6 @@ import OutputAssetPrefixExtend from '@site-docs/components/output-asset-prefix-e
|
|
14
13
|
|
15
14
|
<OutputAssetPrefixExtend />
|
16
15
|
|
17
|
-
import
|
16
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
18
17
|
|
19
|
-
<
|
18
|
+
<RsbuildConfig configName="output.assetPrefix" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: charset
|
3
|
-
configName: output.charset
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.charset
|
@@ -10,6 +9,6 @@ configName: output.charset
|
|
10
9
|
|
11
10
|
`charset` 配置项允许你指定输出文件的[字符编码](https://developer.mozilla.org/en-US/docs/Glossary/Character_encoding) 字符编码,以确保它们在不同的环境中能够正确显示。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="output.charset" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: copy
|
3
|
-
configName: output.copy
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.copy
|
@@ -10,6 +9,6 @@ configName: output.copy
|
|
10
9
|
|
11
10
|
将指定的文件或目录拷贝到构建输出目录中,基于 [rspack.CopyRspackPlugin](https://rspack.dev/zh/plugins/rspack/copy-rspack-plugin) 实现。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="output.copy" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: cssModules
|
3
|
-
configName: output.cssModules
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.cssModules
|
@@ -48,6 +47,6 @@ const defaultCssModules = {
|
|
48
47
|
|
49
48
|
自定义 CSS 模块配置。
|
50
49
|
|
51
|
-
import
|
50
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
52
51
|
|
53
|
-
<
|
52
|
+
<RsbuildConfig configName="output.cssModules" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: dataUriLimit
|
3
|
-
configName: output.dataUriLimit
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.dataUriLimit
|
@@ -26,6 +25,6 @@ const defaultDatUriLimit = 10000;
|
|
26
25
|
|
27
26
|
设置图片、字体、媒体等静态资源被自动内联为 base64 的体积阈值。
|
28
27
|
|
29
|
-
import
|
28
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
30
29
|
|
31
|
-
<
|
30
|
+
<RsbuildConfig configName="output.dataUriLimit" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: distPath
|
3
|
-
configName: output.distPath
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.distPath
|
@@ -18,7 +17,6 @@ type DistPathConfig = {
|
|
18
17
|
wasm?: string;
|
19
18
|
image?: string;
|
20
19
|
media?: string;
|
21
|
-
server?: string;
|
22
20
|
worker?: string;
|
23
21
|
assets?: string;
|
24
22
|
};
|
@@ -43,6 +41,6 @@ const defaultDistPath = {
|
|
43
41
|
|
44
42
|
设置构建产物的输出目录,Modern.js 会根据产物的类型输出到对应的子目录下。
|
45
43
|
|
46
|
-
import
|
44
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
47
45
|
|
48
|
-
<
|
46
|
+
<RsbuildConfig configName="output.distPath" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: externals
|
3
|
-
configName: output.externals
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.externals
|
@@ -20,6 +19,6 @@ type Externals =
|
|
20
19
|
|
21
20
|
在构建时,防止将代码中某些 `import` 的依赖包打包到 bundle 中,而是在运行时再去从外部获取这些依赖。
|
22
21
|
|
23
|
-
import
|
22
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
24
23
|
|
25
|
-
<
|
24
|
+
<RsbuildConfig configName="output.externals" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: filenameHash
|
3
|
-
configName: output.filenameHash
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.filenameHash
|
@@ -10,6 +9,6 @@ configName: output.filenameHash
|
|
10
9
|
|
11
10
|
在生产模式构建后,是否在产物的文件名中添加 hash 值。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="output.filenameHash" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: filename
|
3
|
-
configName: output.filename
|
4
3
|
---
|
5
4
|
|
6
5
|
:::warning
|
@@ -60,6 +59,6 @@ const prodDefaultFilename = {
|
|
60
59
|
|
61
60
|
设置构建产物的名称。
|
62
61
|
|
63
|
-
import
|
62
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
64
63
|
|
65
|
-
<
|
64
|
+
<RsbuildConfig configName="output.filename" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: injectStyles
|
3
|
-
configName: output.injectStyles
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.injectStyles
|
@@ -10,6 +9,6 @@ configName: output.injectStyles
|
|
10
9
|
|
11
10
|
是否将 CSS 样式插入到 DOM 中。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="output.injectStyles" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: inlineScripts
|
3
|
-
configName: output.inlineScripts
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.inlineScripts
|
@@ -29,6 +28,6 @@ type InlineScripts =
|
|
29
28
|
当使用约定式路由时,如果开启了这个选项,需要将 [output.splitRouteChunks](/configure/app/output/split-route-chunks) 设置为 false。
|
30
29
|
:::
|
31
30
|
|
32
|
-
import
|
31
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
33
32
|
|
34
|
-
<
|
33
|
+
<RsbuildConfig configName="output.inlineScripts" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: inlineStyles
|
3
|
-
configName: output.inlineStyles
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.inlineStyles
|
@@ -29,6 +28,6 @@ type InlineStyles =
|
|
29
28
|
当使用约定式路由时,如果开启了这个选项,需要将 [output.splitRouteChunks](/configure/app/output/split-route-chunks) 设置为 false。
|
30
29
|
:::
|
31
30
|
|
32
|
-
import
|
31
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
33
32
|
|
34
|
-
<
|
33
|
+
<RsbuildConfig configName="output.inlineStyles" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: legalComments
|
3
|
-
configName: output.legalComments
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.legalComments
|
@@ -18,6 +17,6 @@ legal comment 是 JS 或 CSS 文件中的一些特殊注释,这些注释包含
|
|
18
17
|
- `inline`:保留所有 legal comments。
|
19
18
|
- `none`:移除所有 legal comments。
|
20
19
|
|
21
|
-
import
|
20
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
22
21
|
|
23
|
-
<
|
22
|
+
<RsbuildConfig configName="output.legalComments" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: minify
|
3
|
-
configName: output.minify
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.minify
|
@@ -22,6 +21,6 @@ type Minify =
|
|
22
21
|
|
23
22
|
用于设置是否在生产模式下开启代码压缩,或是配置压缩工具的选项。
|
24
23
|
|
25
|
-
import
|
24
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
26
25
|
|
27
|
-
<
|
26
|
+
<RsbuildConfig configName="output.minify" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: overrideBrowserslist
|
3
|
-
configName: output.overrideBrowserslist
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.overrideBrowserslist
|
@@ -22,6 +21,6 @@ const defaultBrowserListMap: Record<RsbuildTarget, string[]> = {
|
|
22
21
|
|
23
22
|
Modern.js 会优先使用项目根目录的 `.browserslistrc` 文件中的配置。
|
24
23
|
|
25
|
-
import
|
24
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
26
25
|
|
27
|
-
<
|
26
|
+
<RsbuildConfig configName="output.overrideBrowserslist" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: polyfill
|
3
|
-
configName: output.polyfill
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.polyfill
|
@@ -14,6 +13,6 @@ import OutputPolyfillExtend from '@site-docs/components/output-polyfill-extend';
|
|
14
13
|
|
15
14
|
<OutputPolyfillExtend />
|
16
15
|
|
17
|
-
import
|
16
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
18
17
|
|
19
|
-
<
|
18
|
+
<RsbuildConfig configName="output.polyfill" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: sourceMap
|
3
|
-
configName: output.sourceMap
|
4
3
|
---
|
5
4
|
|
6
5
|
# output.sourceMap
|
@@ -27,6 +26,6 @@ const defaultSourceMap = {
|
|
27
26
|
|
28
27
|
用于设置是否生成 source map 文件,以及生成哪一种格式的 source map。
|
29
28
|
|
30
|
-
import
|
29
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
31
30
|
|
32
|
-
<
|
31
|
+
<RsbuildConfig configName="output.sourceMap" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: buildCache
|
3
|
-
configName: performance.buildCache
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.buildCache
|
@@ -41,6 +40,6 @@ export default {
|
|
41
40
|
|
42
41
|
需要注意的是,Rspack 的持久化缓存处于[实验性阶段](https://rspack.dev/zh/config/experiments#experimentscache),可能会在未来的版本中发生变化,该功能需要手动开启。
|
43
42
|
|
44
|
-
import
|
43
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
45
44
|
|
46
|
-
<
|
45
|
+
<RsbuildConfig configName="performance.buildCache" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: bundleAnalyze
|
3
|
-
configName: performance.bundleAnalyze
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.bundleAnalyze
|
@@ -20,6 +19,6 @@ const defaultConfig = {
|
|
20
19
|
};
|
21
20
|
```
|
22
21
|
|
23
|
-
import
|
22
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
24
23
|
|
25
|
-
<
|
24
|
+
<RsbuildConfig configName="performance.bundleAnalyze" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: chunkSplit
|
3
|
-
configName: performance.chunkSplit
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.chunkSplit
|
@@ -40,6 +39,6 @@ interface SplitCustom {
|
|
40
39
|
export type ChunkSplit = BaseChunkSplit | SplitBySize | SplitCustom;
|
41
40
|
```
|
42
41
|
|
43
|
-
import
|
42
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
44
43
|
|
45
|
-
<
|
44
|
+
<RsbuildConfig configName="performance.chunkSplit" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: dnsPrefetch
|
3
|
-
configName: performance.dnsPrefetch
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.dnsPrefetch
|
@@ -15,6 +14,6 @@ configName: performance.dnsPrefetch
|
|
15
14
|
|
16
15
|
更多信息可参考:[Using dns-prefetch](https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch)
|
17
16
|
|
18
|
-
import
|
17
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
19
18
|
|
20
|
-
<
|
19
|
+
<RsbuildConfig configName="performance.dnsPrefetch" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: preconnect
|
3
|
-
configName: performance.preconnect
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.preconnect
|
@@ -16,6 +15,6 @@ interface PreconnectOption {
|
|
16
15
|
|
17
16
|
- **默认值:** `undefined`
|
18
17
|
|
19
|
-
import
|
18
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
20
19
|
|
21
|
-
<
|
20
|
+
<RsbuildConfig configName="performance.preconnect" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: prefetch
|
3
|
-
configName: performance.prefetch
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.prefetch
|
@@ -21,6 +20,6 @@ interface PrefetchOption {
|
|
21
20
|
|
22
21
|
- **默认值:** `undefined`
|
23
22
|
|
24
|
-
import
|
23
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
25
24
|
|
26
|
-
<
|
25
|
+
<RsbuildConfig configName="performance.prefetch" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: preload
|
3
|
-
configName: performance.preload
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.preload
|
@@ -23,6 +22,6 @@ interface PreloadOption {
|
|
23
22
|
|
24
23
|
为 Rsbuild 构建生成的静态资源注入 [`<link rel="preload">`](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload) 标签。
|
25
24
|
|
26
|
-
import
|
25
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
27
26
|
|
28
|
-
<
|
27
|
+
<RsbuildConfig configName="performance.preload" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: printFileSize
|
3
|
-
configName: performance.printFileSize
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.printFileSize
|
@@ -40,6 +39,6 @@ info Production file sizes:
|
|
40
39
|
dist/static/css/main.03221f72.css 1.4 kB 741 B
|
41
40
|
```
|
42
41
|
|
43
|
-
import
|
42
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
44
43
|
|
45
|
-
<
|
44
|
+
<RsbuildConfig configName="performance.printFileSize" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: profile
|
3
|
-
configName: performance.profile
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.profile
|
@@ -10,6 +9,6 @@ configName: performance.profile
|
|
10
9
|
|
11
10
|
是否捕获每个模块的耗时信息,对应 Rspack 的 [profile](https://webpack.js.org/configuration/other-options/#profile) 配置。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="performance.profile" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: removeConsole
|
3
|
-
configName: performance.removeConsole
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.removeConsole
|
@@ -10,6 +9,6 @@ configName: performance.removeConsole
|
|
10
9
|
|
11
10
|
在生产环境构建时,是否自动移除代码中的 `console.[methodName]`。
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="performance.removeConsole" />
|