@modern-js/main-doc 2.67.5 → 2.67.6
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 -3
- 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/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 +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/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 +211 -20
- package/docs/en/guides/basic-features/deploy.mdx +3 -3
- package/docs/en/guides/basic-features/output-files.mdx +0 -28
- 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/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 +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/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 +209 -25
- package/docs/zh/guides/basic-features/deploy.mdx +4 -3
- package/docs/zh/guides/basic-features/output-files.mdx +0 -28
- 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: 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" />
|
@@ -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
|
It should be noted that, Rspack's persistent cache is [experimental](https://rspack.dev/config/experiments#experimentscache), which may change in future versions, and this feature needs to be turned on manually.
|
43
42
|
|
44
|
-
import
|
43
|
+
import RsbuildConfig from '@site-docs-en/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-en/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-en/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 @@ After this property is set, the domain name can be resolved before the resource
|
|
15
14
|
|
16
15
|
See [Using dns-prefetch](https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch) for more details.
|
17
16
|
|
18
|
-
import
|
17
|
+
import RsbuildConfig from '@site-docs-en/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
|
- **Default:** `undefined`
|
18
17
|
|
19
|
-
import
|
18
|
+
import RsbuildConfig from '@site-docs-en/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
|
- **Default:** `undefined`
|
23
22
|
|
24
|
-
import
|
23
|
+
import RsbuildConfig from '@site-docs-en/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
|
Inject the [`<link rel="preload">`](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Attributes/rel/preload) tags for the static assets generated by Rsbuild.
|
25
24
|
|
26
|
-
import
|
25
|
+
import RsbuildConfig from '@site-docs-en/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-en/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
|
Whether capture timing information for each module, same as the [profile](https://webpack.js.org/configuration/other-options/#profile) config of Rspack.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/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
|
Whether to remove `console.[methodName]` in production build.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="performance.removeConsole" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: removeMomentLocale
|
3
|
-
configName: performance.removeMomentLocale
|
4
3
|
---
|
5
4
|
|
6
5
|
# performance.removeMomentLocale
|
@@ -10,6 +9,6 @@ configName: performance.removeMomentLocale
|
|
10
9
|
|
11
10
|
Whether to remove the locales of [moment.js](https://momentjs.com/).
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="performance.removeMomentLocale" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: nonce
|
3
|
-
configName: security.nonce
|
4
3
|
---
|
5
4
|
|
6
5
|
# security.nonce
|
@@ -15,6 +14,6 @@ type Nonce = string;
|
|
15
14
|
|
16
15
|
Adding a `nonce` attribute to the scripts resources introduced for HTML. This allows the browser to determine whether the script can be executed when it parses inline scripts with matching nonce values.
|
17
16
|
|
18
|
-
import
|
17
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
19
18
|
|
20
|
-
<
|
19
|
+
<RsbuildConfig configName="security.nonce" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: port
|
3
|
-
configName: server.port
|
4
3
|
---
|
5
4
|
|
6
5
|
# server.port
|
@@ -38,6 +37,6 @@ export default defineConfig({
|
|
38
37
|
});
|
39
38
|
```
|
40
39
|
|
41
|
-
import
|
40
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
42
41
|
|
43
|
-
<
|
42
|
+
<RsbuildConfig configName="server.port" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: aliasStrategy
|
3
|
-
configName: source.aliasStrategy
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.aliasStrategy
|
@@ -10,6 +9,6 @@ configName: source.aliasStrategy
|
|
10
9
|
|
11
10
|
`source.aliasStrategy` is used to control the priority between the `paths` option in `tsconfig.json` and the `alias` option in the bundler.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="source.aliasStrategy" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: alias
|
3
|
-
configName: source.alias
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.alias
|
@@ -19,6 +18,6 @@ Create aliases to import or require certain modules, same as the [resolve.alias]
|
|
19
18
|
For TypeScript projects, you only need to configure [compilerOptions.paths](https://www.typescriptlang.org/tsconfig#paths) in the `tsconfig.json` file. The Rsbuild will automatically recognize it, so there is no need to configure the `source.alias` option separately. For more details, please refer to [Path Aliases](https://modernjs.dev/en/guides/basic-features/alias.html).
|
20
19
|
:::
|
21
20
|
|
22
|
-
import
|
21
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
23
22
|
|
24
|
-
<
|
23
|
+
<RsbuildConfig configName="source.alias" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: decorators
|
3
|
-
configName: source.decorators
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.decorators
|
@@ -23,6 +22,6 @@ const defaultDecorators = {
|
|
23
22
|
|
24
23
|
Used to configure the decorators syntax.
|
25
24
|
|
26
|
-
import
|
25
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
27
26
|
|
28
|
-
<
|
27
|
+
<RsbuildConfig configName="source.decorators" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: define
|
3
|
-
configName: source.define
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.define
|
@@ -16,6 +15,6 @@ const defaultDefine = {
|
|
16
15
|
|
17
16
|
Replaces variables in your code with other values or expressions at compile time. This can be useful for allowing different behavior between development builds and production builds.
|
18
17
|
|
19
|
-
import
|
18
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
20
19
|
|
21
|
-
<
|
20
|
+
<RsbuildConfig configName="source.define" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: exclude
|
3
|
-
configName: source.exclude
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.exclude
|
@@ -10,6 +9,6 @@ configName: source.exclude
|
|
10
9
|
|
11
10
|
Specifies JavaScript/TypeScript files that do not need to be compiled. The usage is consistent with [Rule.exclude](https://rspack.dev/config/module#ruleexclude) in Rspack, which supports passing in strings or regular expressions to match the module path.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="source.exclude" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: include
|
3
|
-
configName: source.include
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.include
|
@@ -21,6 +20,6 @@ const defaultInclude = [
|
|
21
20
|
|
22
21
|
The `source.include` is used to specify additional JavaScript files that need to be compiled.
|
23
22
|
|
24
|
-
import
|
23
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
25
24
|
|
26
|
-
<
|
25
|
+
<RsbuildConfig configName="source.include" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: preEntry
|
3
|
-
configName: source.preEntry
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.preEntry
|
@@ -10,6 +9,6 @@ configName: source.preEntry
|
|
10
9
|
|
11
10
|
Add a script before the entry file of each page. This script will be executed before the page code. It can be used to execute global logics, such as injecting polyfills, setting global styles, etc.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="source.preEntry" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: transformImport
|
3
|
-
configName: source.transformImport
|
4
3
|
---
|
5
4
|
|
6
5
|
# source.transformImport
|
@@ -59,9 +58,9 @@ const defaultArcoConfig = [
|
|
59
58
|
When you add configurations for `antd` or `@arco-design/web-react`, the priority will be higher than the default configurations mentioned above.
|
60
59
|
:::
|
61
60
|
|
62
|
-
import
|
61
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
63
62
|
|
64
|
-
<
|
63
|
+
<RsbuildConfig configName="source.transformImport" />
|
65
64
|
|
66
65
|
### Disable Default Config
|
67
66
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: cssExtract
|
3
|
-
configName: tools.cssExtract
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.cssExtract
|
@@ -33,6 +32,6 @@ const defaultOptions = {
|
|
33
32
|
|
34
33
|
The config of [CssExtractRspackPlugin](https://www.rspack.dev/plugins/rspack/css-extract-rspack-plugin) / [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) can be modified through `tools.cssExtract`.
|
35
34
|
|
36
|
-
import
|
35
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
37
36
|
|
38
|
-
<
|
37
|
+
<RsbuildConfig configName="tools.cssExtract" />
|
@@ -16,6 +16,6 @@ const defaultOptions = {
|
|
16
16
|
|
17
17
|
The config of [css-loader](https://github.com/webpack-contrib/css-loader) can be modified through `tools.cssLoader`.
|
18
18
|
|
19
|
-
import
|
19
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
20
20
|
|
21
|
-
<
|
21
|
+
<RsbuildConfig configName="tools.cssLoader" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: htmlPlugin
|
3
|
-
configName: tools.htmlPlugin
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.htmlPlugin
|
@@ -34,8 +33,13 @@ const defaultOptions = {
|
|
34
33
|
};
|
35
34
|
```
|
36
35
|
|
36
|
+
:::warning
|
37
|
+
SSR Application does not enable the `minify.removeComments` configuration, otherwise the SSR rendering will fail.
|
38
|
+
:::
|
39
|
+
|
40
|
+
|
37
41
|
The configs of [html-rspack-plugin](https://github.com/rspack-contrib/html-rspack-plugin) or [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) can be modified through `tools.htmlPlugin`.
|
38
42
|
|
39
|
-
import
|
43
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
40
44
|
|
41
|
-
<
|
45
|
+
<RsbuildConfig configName="tools.htmlPlugin" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: lightningcssLoader
|
3
|
-
configName: tools.lightningcssLoader
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.lightningcssLoader
|
@@ -36,6 +35,6 @@ const defaultOptions = {
|
|
36
35
|
|
37
36
|
It should be noted that when `lightningcss-loader` is turned on, `postcss-loader` will be turned off by default.
|
38
37
|
|
39
|
-
import
|
38
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
40
39
|
|
41
|
-
<
|
40
|
+
<RsbuildConfig configName="tools.lightningcssLoader" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: postcss
|
3
|
-
configName: tools.postcss
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.postcss
|
@@ -34,6 +33,6 @@ Modern.js integrates PostCSS by default, you can configure [postcss-loader](http
|
|
34
33
|
|
35
34
|
It should be noted that when you enable the `tools.lightningcss` configuration, PostCSS will be disabled by default, including `postcss-loader` and its default plugins.
|
36
35
|
|
37
|
-
import
|
36
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
38
37
|
|
39
|
-
<
|
38
|
+
<RsbuildConfig configName="tools.postcss" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: rspack
|
3
|
-
configName: tools.rspack
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.rspack
|
@@ -10,6 +9,6 @@ configName: tools.rspack
|
|
10
9
|
|
11
10
|
`tools.rspack` is used to configure [Rspack](https://rspack.dev/).
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="tools.rspack" />
|
@@ -1,6 +1,5 @@
|
|
1
1
|
---
|
2
2
|
title: styleLoader
|
3
|
-
configName: tools.styleLoader
|
4
3
|
---
|
5
4
|
|
6
5
|
# tools.styleLoader
|
@@ -10,6 +9,6 @@ configName: tools.styleLoader
|
|
10
9
|
|
11
10
|
The config of [style-loader](https://github.com/webpack-contrib/style-loader) can be set through `tools.styleLoader`.
|
12
11
|
|
13
|
-
import
|
12
|
+
import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
|
14
13
|
|
15
|
-
<
|
14
|
+
<RsbuildConfig configName="tools.styleLoader" />
|
@@ -21,7 +21,7 @@ When using Rspack as the bundler, SWC will be used for transpiling and compressi
|
|
21
21
|
|
22
22
|
You can set the options of [builtin:swc-loader](https://rspack.dev/guide/features/builtin-swc-loader) through `tools.swc`.
|
23
23
|
|
24
|
-
```
|
24
|
+
```ts
|
25
25
|
import { defineConfig } from '@modern-js/app-tools';
|
26
26
|
|
27
27
|
export default defineConfig<'rspack'>({
|