@modern-js/main-doc 0.0.0-nightly-20250515160310 → 0.0.0-nightly-20250518160324
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/src/routes.mdx +3 -3
- package/docs/en/components/rsbuild-config-tooltip.mdx +2 -2
- 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 -3
- 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/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/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 +2 -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/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/src/routes.mdx +3 -3
- package/docs/zh/components/rsbuild-config-tooltip.mdx +2 -2
- 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 -3
- 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/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/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 +2 -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/tutorials/first-app/c04-routes.mdx +4 -2
- package/docs/zh/tutorials/first-app/c05-loader.mdx +4 -1
- package/package.json +6 -4
- package/rspress.config.ts +6 -1
- package/src/components/RsbuildLink/index.tsx +2 -2
- package/src/index.ts +1 -5
- package/src/pages/index.tsx +3 -3
|
@@ -10,11 +10,11 @@ Conventional routing uses `routes/` as the convention for the entry point and an
|
|
|
10
10
|
|
|
11
11
|
Any `layout.[tj]sx` and `page.[tj]sx` under `src/routes` will be used as the application's routes:
|
|
12
12
|
|
|
13
|
-
```bash
|
|
13
|
+
```bash
|
|
14
14
|
.
|
|
15
15
|
└── routes
|
|
16
|
-
├── layout.tsx
|
|
17
|
-
├── page.tsx
|
|
16
|
+
├── layout.tsx # [!code highlight]
|
|
17
|
+
├── page.tsx # [!code highlight]
|
|
18
18
|
└── user
|
|
19
19
|
├── layout.tsx
|
|
20
20
|
└── page.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import RsbuildLink from '@site/src/components/RsbuildLink';
|
|
2
2
|
|
|
3
3
|
:::info
|
|
4
|
-
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to <
|
|
4
|
+
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to <RsbuildLink configName={props.configName}/>.
|
|
5
5
|
:::
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: assetPrefix
|
|
3
|
-
configName: dev.assetPrefix
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.assetPrefix
|
|
@@ -10,9 +9,9 @@ configName: dev.assetPrefix
|
|
|
10
9
|
|
|
11
10
|
This configuration item is used to set the URL prefix of static resources in **development mode**.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
14
13
|
|
|
15
|
-
<
|
|
14
|
+
<RsbuildConfig configName="dev.assetPrefix" />
|
|
16
15
|
|
|
17
16
|
:::warning
|
|
18
17
|
Please note that this configuration item is only applicable in development mode. In production mode, please use the [output.assetPrefix](/configure/app/output/asset-prefix) configuration item for setting.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: client
|
|
3
|
-
configName: dev.client
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.client
|
|
@@ -41,6 +40,6 @@ const defaultConfig = {
|
|
|
41
40
|
|
|
42
41
|
Configure the client code injected by Modern.js during the development process. This can be used to set the WebSocket URL for HMR.
|
|
43
42
|
|
|
44
|
-
import
|
|
43
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
45
44
|
|
|
46
|
-
<
|
|
45
|
+
<RsbuildConfig configName="dev.client" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: hmr
|
|
3
|
-
configName: dev.hmr
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.hmr
|
|
@@ -10,6 +9,6 @@ configName: dev.hmr
|
|
|
10
9
|
|
|
11
10
|
Whether to enable Hot Module Replacement.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
14
13
|
|
|
15
|
-
<
|
|
14
|
+
<RsbuildConfig configName="dev.hmr" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: liveReload
|
|
3
|
-
configName: dev.liveReload
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.liveReload
|
|
@@ -10,6 +9,6 @@ configName: dev.liveReload
|
|
|
10
9
|
|
|
11
10
|
Whether to reload the page when source files are changed.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
14
13
|
|
|
15
|
-
<
|
|
14
|
+
<RsbuildConfig configName="dev.liveReload" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: progressBar
|
|
3
|
-
configName: dev.progressBar
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.progressBar
|
|
@@ -19,6 +18,6 @@ type ProgressBar =
|
|
|
19
18
|
|
|
20
19
|
Whether to display progress bar during compilation.
|
|
21
20
|
|
|
22
|
-
import
|
|
21
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
23
22
|
|
|
24
|
-
<
|
|
23
|
+
<RsbuildConfig configName="dev.progressBar" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: setupMiddlewares
|
|
3
|
-
configName: dev.setupMiddlewares
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.setupMiddlewares
|
|
@@ -50,6 +49,6 @@ type SetupMiddlewares = Array<
|
|
|
50
49
|
|
|
51
50
|
Provides the ability to execute a custom function and apply custom middlewares.
|
|
52
51
|
|
|
53
|
-
import
|
|
52
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
54
53
|
|
|
55
|
-
<
|
|
54
|
+
<RsbuildConfig configName="dev.setupMiddlewares" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: watchFiles
|
|
3
|
-
configName: dev.watchFiles
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.watchFiles
|
|
@@ -27,6 +26,6 @@ type WatchFilesConfig = WatchFiles | WatchFiles[];
|
|
|
27
26
|
|
|
28
27
|
Watch specified files and directories for changes. When a file change is detected, it can trigger a page reload or restart the dev server.
|
|
29
28
|
|
|
30
|
-
import
|
|
29
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
31
30
|
|
|
32
|
-
<
|
|
31
|
+
<RsbuildConfig configName="dev.watchFiles" />
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: writeToDisk
|
|
3
|
-
configName: dev.writeToDisk
|
|
4
3
|
---
|
|
5
4
|
|
|
6
5
|
# dev.writeToDisk
|
|
@@ -10,6 +9,6 @@ configName: dev.writeToDisk
|
|
|
10
9
|
|
|
11
10
|
Controls whether the build output from development mode is written to disk.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
14
13
|
|
|
15
|
-
<
|
|
14
|
+
<RsbuildConfig configName="dev.writeToDisk" />
|
|
@@ -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-en/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
|
|
@@ -10,6 +9,6 @@ configName: html.crossorigin
|
|
|
10
9
|
|
|
11
10
|
Set the [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) attribute of the `<script>` and `<style>` tags.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
14
13
|
|
|
15
|
-
<
|
|
14
|
+
<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
|
|
@@ -16,6 +15,6 @@ Set the favicon icon path for all pages, can be set as:
|
|
|
16
15
|
|
|
17
16
|
After config this option, the favicon will be automatically copied to the dist directory during the compilation, and the corresponding `link` tag will be added to the HTML.
|
|
18
17
|
|
|
19
|
-
import
|
|
18
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
20
19
|
|
|
21
|
-
<
|
|
20
|
+
<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
|
Set the inject position of the `<script>` tag.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Configure the `<meta>` tag of the HTML.
|
|
26
25
|
|
|
27
|
-
import
|
|
26
|
+
import RsbuildConfig from '@site-docs-en/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
|
By default, the `root` element is included in the HTML template for component mounting, and the element id can be modified through `mountId`.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Define the directory structure of the HTML output files.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Used to set how `<script>` tags are loaded.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Modifies the tags that are injected into the HTML page.
|
|
17
16
|
|
|
18
|
-
import
|
|
17
|
+
import RsbuildConfig from '@site-docs-en/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
|
Define the parameters in the HTML template, corresponding to the `templateParameters` config of [html-rspack-plugin](https://github.com/rspack-contrib/html-rspack-plugin). You can use the config as an object or a function.
|
|
35
34
|
|
|
36
|
-
import
|
|
35
|
+
import RsbuildConfig from '@site-docs-en/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
|
Specifies the file path for the HTML template, which can be a relative or absolute path.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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-en/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-en/components/output-asset-prefi
|
|
|
14
13
|
|
|
15
14
|
<OutputAssetPrefixExtend />
|
|
16
15
|
|
|
17
|
-
import
|
|
16
|
+
import RsbuildConfig from '@site-docs-en/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
|
The `charset` config allows you to specify the [character encoding](https://developer.mozilla.org/en-US/docs/Glossary/Character_encoding) for output files to ensure they are displayed correctly in different environments.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Copies the specified file or directory to the dist directory, implemented based on [rspack.CopyRspackPlugin](https://rspack.dev/zh/plugins/rspack/copy-rspack-plugin).
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
For custom CSS Modules configuration.
|
|
50
49
|
|
|
51
|
-
import
|
|
50
|
+
import RsbuildConfig from '@site-docs-en/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
|
Set the size threshold to inline static assets such as images and fonts.
|
|
28
27
|
|
|
29
|
-
import
|
|
28
|
+
import RsbuildConfig from '@site-docs-en/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
|
|
@@ -43,6 +42,6 @@ const defaultDistPath = {
|
|
|
43
42
|
|
|
44
43
|
Set the directory of the dist files. Modern.js will output files to the corresponding subdirectory according to the file type.
|
|
45
44
|
|
|
46
|
-
import
|
|
45
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
47
46
|
|
|
48
|
-
<
|
|
47
|
+
<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
|
At build time, prevent some `import` dependencies from being packed into bundles in your code, and instead fetch them externally at runtime.
|
|
22
21
|
|
|
23
|
-
import
|
|
22
|
+
import RsbuildConfig from '@site-docs-en/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
|
Whether to add a hash value to the filename after the production build.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
|
@@ -57,6 +56,6 @@ const prodDefaultFilename = {
|
|
|
57
56
|
|
|
58
57
|
Sets the filename of dist files.
|
|
59
58
|
|
|
60
|
-
import
|
|
59
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
61
60
|
|
|
62
|
-
<
|
|
61
|
+
<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
|
Whether to inject styles into DOM.
|
|
12
11
|
|
|
13
|
-
import
|
|
12
|
+
import RsbuildConfig from '@site-docs-en/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 @@ Whether to inline output scripts files (.js files) into HTML with `<script>` tag
|
|
|
29
28
|
When using convention-based routing, you need to set [output.splitRouteChunks](/configure/app/output/split-route-chunks) to false if this option is turned on.
|
|
30
29
|
:::
|
|
31
30
|
|
|
32
|
-
import
|
|
31
|
+
import RsbuildConfig from '@site-docs-en/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 @@ Whether to inline output style files (.css files) into HTML with `<style>` tags.
|
|
|
29
28
|
When using convention-based routing, you need to set [output.splitRouteChunks](/configure/app/output/split-route-chunks) to false if this option is turned on.
|
|
30
29
|
:::
|
|
31
30
|
|
|
32
|
-
import
|
|
31
|
+
import RsbuildConfig from '@site-docs-en/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 @@ This behavior can be configured by using one of the following options:
|
|
|
18
17
|
- `inline`: Preserve all legal comments in original position.
|
|
19
18
|
- `none`: Remove all legal comments.
|
|
20
19
|
|
|
21
|
-
import
|
|
20
|
+
import RsbuildConfig from '@site-docs-en/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
|
Configure whether to enable code minification in production mode, or to configure minimizer options.
|
|
24
23
|
|
|
25
|
-
import
|
|
24
|
+
import RsbuildConfig from '@site-docs-en/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
|
|
@@ -20,6 +19,6 @@ Modern.js will give priority to using the configuration in the `.browserslistrc`
|
|
|
20
19
|
|
|
21
20
|
Specifies the range of target browsers that the project is compatible with. This value will be used by [SWC](https://github.com/swc-project/swc) and [autoprefixer](https://github.com/postcss/autoprefixer) to identify the JavaScript syntax that need to be transformed and the CSS browser prefixes that need to be added.
|
|
22
21
|
|
|
23
|
-
import
|
|
22
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
24
23
|
|
|
25
|
-
<
|
|
24
|
+
<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-en/components/output-polyfill-exten
|
|
|
14
13
|
|
|
15
14
|
<OutputPolyfillExtend />
|
|
16
15
|
|
|
17
|
-
import
|
|
16
|
+
import RsbuildConfig from '@site-docs-en/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
|
Used to set whether to generate source map files, and which format of source map to generate.
|
|
29
28
|
|
|
30
|
-
import
|
|
29
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
|
31
30
|
|
|
32
|
-
<
|
|
31
|
+
<RsbuildConfig configName="output.sourceMap" />
|