@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.
Files changed (208) hide show
  1. package/docs/en/apis/app/hooks/server/server.mdx +10 -0
  2. package/docs/en/apis/app/hooks/src/routes.mdx +3 -73
  3. package/docs/en/apis/app/runtime/bff/use-hono-context.mdx +30 -0
  4. package/docs/en/components/enable-bff.mdx +1 -27
  5. package/docs/en/components/rsbuild-config-tooltip.mdx +2 -2
  6. package/docs/en/components/tech-stack-node-framework.mdx +1 -1
  7. package/docs/en/configure/app/dev/asset-prefix.mdx +2 -3
  8. package/docs/en/configure/app/dev/client.mdx +2 -3
  9. package/docs/en/configure/app/dev/hmr.mdx +2 -3
  10. package/docs/en/configure/app/dev/live-reload.mdx +2 -3
  11. package/docs/en/configure/app/dev/progress-bar.mdx +2 -3
  12. package/docs/en/configure/app/dev/setup-middlewares.mdx +2 -3
  13. package/docs/en/configure/app/dev/watch-files.mdx +2 -3
  14. package/docs/en/configure/app/dev/write-to-disk.mdx +2 -3
  15. package/docs/en/configure/app/html/app-icon.mdx +2 -3
  16. package/docs/en/configure/app/html/crossorigin.mdx +2 -3
  17. package/docs/en/configure/app/html/favicon.mdx +2 -3
  18. package/docs/en/configure/app/html/inject.mdx +2 -3
  19. package/docs/en/configure/app/html/meta.mdx +2 -3
  20. package/docs/en/configure/app/html/mount-id.mdx +2 -3
  21. package/docs/en/configure/app/html/output-structure.mdx +2 -3
  22. package/docs/en/configure/app/html/script-loading.mdx +2 -3
  23. package/docs/en/configure/app/html/tags.mdx +2 -3
  24. package/docs/en/configure/app/html/template-parameters.mdx +2 -3
  25. package/docs/en/configure/app/html/template.mdx +2 -3
  26. package/docs/en/configure/app/html/title.mdx +2 -3
  27. package/docs/en/configure/app/output/asset-prefix.mdx +2 -3
  28. package/docs/en/configure/app/output/charset.mdx +2 -3
  29. package/docs/en/configure/app/output/copy.mdx +2 -3
  30. package/docs/en/configure/app/output/css-modules.mdx +2 -3
  31. package/docs/en/configure/app/output/data-uri-limit.mdx +2 -3
  32. package/docs/en/configure/app/output/dist-path.mdx +2 -4
  33. package/docs/en/configure/app/output/externals.mdx +2 -3
  34. package/docs/en/configure/app/output/filename-hash.mdx +2 -3
  35. package/docs/en/configure/app/output/filename.mdx +2 -3
  36. package/docs/en/configure/app/output/inject-styles.mdx +2 -3
  37. package/docs/en/configure/app/output/inline-scripts.mdx +2 -3
  38. package/docs/en/configure/app/output/inline-styles.mdx +2 -3
  39. package/docs/en/configure/app/output/legal-comments.mdx +2 -3
  40. package/docs/en/configure/app/output/minify.mdx +2 -3
  41. package/docs/en/configure/app/output/override-browserslist.mdx +2 -3
  42. package/docs/en/configure/app/output/polyfill.mdx +2 -3
  43. package/docs/en/configure/app/output/source-map.mdx +2 -3
  44. package/docs/en/configure/app/performance/build-cache.mdx +2 -3
  45. package/docs/en/configure/app/performance/bundle-analyze.mdx +2 -3
  46. package/docs/en/configure/app/performance/chunk-split.mdx +2 -3
  47. package/docs/en/configure/app/performance/dns-prefetch.mdx +2 -3
  48. package/docs/en/configure/app/performance/preconnect.mdx +2 -3
  49. package/docs/en/configure/app/performance/prefetch.mdx +2 -3
  50. package/docs/en/configure/app/performance/preload.mdx +2 -3
  51. package/docs/en/configure/app/performance/print-file-size.mdx +2 -3
  52. package/docs/en/configure/app/performance/profile.mdx +2 -3
  53. package/docs/en/configure/app/performance/remove-console.mdx +2 -3
  54. package/docs/en/configure/app/performance/remove-moment-locale.mdx +2 -3
  55. package/docs/en/configure/app/performance/transform-lodash.mdx +4 -1
  56. package/docs/en/configure/app/security/nonce.mdx +2 -3
  57. package/docs/en/configure/app/security/sri.mdx +0 -1
  58. package/docs/en/configure/app/server/port.mdx +2 -3
  59. package/docs/en/configure/app/source/alias-strategy.mdx +2 -3
  60. package/docs/en/configure/app/source/alias.mdx +2 -3
  61. package/docs/en/configure/app/source/decorators.mdx +2 -3
  62. package/docs/en/configure/app/source/define.mdx +2 -3
  63. package/docs/en/configure/app/source/exclude.mdx +2 -3
  64. package/docs/en/configure/app/source/include.mdx +2 -3
  65. package/docs/en/configure/app/source/module-scopes.mdx +4 -1
  66. package/docs/en/configure/app/source/pre-entry.mdx +2 -3
  67. package/docs/en/configure/app/source/transform-import.mdx +2 -3
  68. package/docs/en/configure/app/tools/css-extract.mdx +2 -3
  69. package/docs/en/configure/app/tools/css-loader.mdx +2 -2
  70. package/docs/en/configure/app/tools/html-plugin.mdx +7 -3
  71. package/docs/en/configure/app/tools/lightningcss-loader.mdx +2 -3
  72. package/docs/en/configure/app/tools/postcss.mdx +2 -3
  73. package/docs/en/configure/app/tools/rspack.mdx +2 -3
  74. package/docs/en/configure/app/tools/style-loader.mdx +2 -3
  75. package/docs/en/configure/app/tools/swc.mdx +1 -1
  76. package/docs/en/configure/app/tools/terser.mdx +4 -2
  77. package/docs/en/configure/app/tools/ts-loader.mdx +4 -1
  78. package/docs/en/configure/app/tools/webpack-chain.mdx +4 -1
  79. package/docs/en/configure/app/tools/webpack.mdx +4 -1
  80. package/docs/en/guides/advanced-features/_meta.json +0 -1
  81. package/docs/en/guides/advanced-features/bff/extend-server.mdx +33 -82
  82. package/docs/en/guides/advanced-features/bff/frameworks.mdx +12 -68
  83. package/docs/en/guides/advanced-features/page-performance/_meta.json +1 -1
  84. package/docs/en/guides/advanced-features/page-performance/react-compiler.mdx +44 -0
  85. package/docs/en/guides/advanced-features/web-server.mdx +223 -20
  86. package/docs/en/guides/basic-features/data/data-cache.mdx +1 -1
  87. package/docs/en/guides/basic-features/deploy.mdx +3 -3
  88. package/docs/en/guides/basic-features/output-files.mdx +0 -28
  89. package/docs/en/guides/basic-features/render/ssr.mdx +1 -1
  90. package/docs/en/guides/basic-features/render/streaming-ssr.mdx +2 -2
  91. package/docs/en/guides/basic-features/routes.mdx +72 -0
  92. package/docs/en/guides/basic-features/static-assets/wasm-assets.mdx +1 -1
  93. package/docs/en/guides/topic-detail/module-federation/deploy.mdx +83 -7
  94. package/docs/en/guides/topic-detail/module-federation/usage.mdx +2 -4
  95. package/docs/en/plugin/cli-plugins/api.mdx +1 -1
  96. package/docs/en/tutorials/first-app/c04-routes.mdx +4 -2
  97. package/docs/en/tutorials/first-app/c05-loader.mdx +4 -1
  98. package/docs/zh/apis/app/hooks/server/server.mdx +10 -0
  99. package/docs/zh/apis/app/hooks/src/routes.mdx +3 -3
  100. package/docs/zh/apis/app/runtime/bff/use-hono-context.mdx +31 -0
  101. package/docs/zh/components/enable-bff.mdx +2 -27
  102. package/docs/zh/components/rsbuild-config-tooltip.mdx +2 -2
  103. package/docs/zh/components/tech-stack-node-framework.mdx +1 -1
  104. package/docs/zh/configure/app/dev/asset-prefix.mdx +2 -3
  105. package/docs/zh/configure/app/dev/client.mdx +2 -3
  106. package/docs/zh/configure/app/dev/hmr.mdx +2 -3
  107. package/docs/zh/configure/app/dev/live-reload.mdx +2 -3
  108. package/docs/zh/configure/app/dev/progress-bar.mdx +2 -3
  109. package/docs/zh/configure/app/dev/setup-middlewares.mdx +2 -3
  110. package/docs/zh/configure/app/dev/watch-files.mdx +2 -3
  111. package/docs/zh/configure/app/dev/write-to-disk.mdx +2 -3
  112. package/docs/zh/configure/app/html/app-icon.mdx +2 -3
  113. package/docs/zh/configure/app/html/crossorigin.mdx +2 -3
  114. package/docs/zh/configure/app/html/favicon.mdx +2 -3
  115. package/docs/zh/configure/app/html/inject.mdx +2 -3
  116. package/docs/zh/configure/app/html/meta.mdx +2 -3
  117. package/docs/zh/configure/app/html/mount-id.mdx +2 -3
  118. package/docs/zh/configure/app/html/output-structure.mdx +2 -3
  119. package/docs/zh/configure/app/html/script-loading.mdx +2 -3
  120. package/docs/zh/configure/app/html/tags.mdx +2 -3
  121. package/docs/zh/configure/app/html/template-parameters.mdx +2 -3
  122. package/docs/zh/configure/app/html/template.mdx +2 -3
  123. package/docs/zh/configure/app/html/title.mdx +2 -3
  124. package/docs/zh/configure/app/output/asset-prefix.mdx +2 -3
  125. package/docs/zh/configure/app/output/charset.mdx +2 -3
  126. package/docs/zh/configure/app/output/copy.mdx +2 -3
  127. package/docs/zh/configure/app/output/css-modules.mdx +2 -3
  128. package/docs/zh/configure/app/output/data-uri-limit.mdx +2 -3
  129. package/docs/zh/configure/app/output/dist-path.mdx +2 -4
  130. package/docs/zh/configure/app/output/externals.mdx +2 -3
  131. package/docs/zh/configure/app/output/filename-hash.mdx +2 -3
  132. package/docs/zh/configure/app/output/filename.mdx +2 -3
  133. package/docs/zh/configure/app/output/inject-styles.mdx +2 -3
  134. package/docs/zh/configure/app/output/inline-scripts.mdx +2 -3
  135. package/docs/zh/configure/app/output/inline-styles.mdx +2 -3
  136. package/docs/zh/configure/app/output/legal-comments.mdx +2 -3
  137. package/docs/zh/configure/app/output/minify.mdx +2 -3
  138. package/docs/zh/configure/app/output/override-browserslist.mdx +2 -3
  139. package/docs/zh/configure/app/output/polyfill.mdx +2 -3
  140. package/docs/zh/configure/app/output/source-map.mdx +2 -3
  141. package/docs/zh/configure/app/performance/build-cache.mdx +2 -3
  142. package/docs/zh/configure/app/performance/bundle-analyze.mdx +2 -3
  143. package/docs/zh/configure/app/performance/chunk-split.mdx +2 -3
  144. package/docs/zh/configure/app/performance/dns-prefetch.mdx +2 -3
  145. package/docs/zh/configure/app/performance/preconnect.mdx +2 -3
  146. package/docs/zh/configure/app/performance/prefetch.mdx +2 -3
  147. package/docs/zh/configure/app/performance/preload.mdx +2 -3
  148. package/docs/zh/configure/app/performance/print-file-size.mdx +2 -3
  149. package/docs/zh/configure/app/performance/profile.mdx +2 -3
  150. package/docs/zh/configure/app/performance/remove-console.mdx +2 -3
  151. package/docs/zh/configure/app/performance/remove-moment-locale.mdx +2 -3
  152. package/docs/zh/configure/app/performance/transform-lodash.mdx +4 -1
  153. package/docs/zh/configure/app/security/nonce.mdx +2 -3
  154. package/docs/zh/configure/app/security/sri.mdx +0 -1
  155. package/docs/zh/configure/app/server/port.mdx +2 -3
  156. package/docs/zh/configure/app/source/alias-strategy.mdx +2 -3
  157. package/docs/zh/configure/app/source/alias.mdx +2 -3
  158. package/docs/zh/configure/app/source/decorators.mdx +2 -3
  159. package/docs/zh/configure/app/source/define.mdx +2 -3
  160. package/docs/zh/configure/app/source/exclude.mdx +2 -3
  161. package/docs/zh/configure/app/source/include.mdx +2 -3
  162. package/docs/zh/configure/app/source/module-scopes.mdx +4 -1
  163. package/docs/zh/configure/app/source/pre-entry.mdx +2 -3
  164. package/docs/zh/configure/app/source/transform-import.mdx +2 -3
  165. package/docs/zh/configure/app/tools/css-extract.mdx +2 -3
  166. package/docs/zh/configure/app/tools/css-loader.mdx +2 -3
  167. package/docs/zh/configure/app/tools/html-plugin.mdx +6 -3
  168. package/docs/zh/configure/app/tools/lightningcss-loader.mdx +2 -3
  169. package/docs/zh/configure/app/tools/postcss.mdx +2 -3
  170. package/docs/zh/configure/app/tools/rspack.mdx +2 -3
  171. package/docs/zh/configure/app/tools/style-loader.mdx +2 -3
  172. package/docs/zh/configure/app/tools/swc.mdx +1 -1
  173. package/docs/zh/configure/app/tools/terser.mdx +4 -2
  174. package/docs/zh/configure/app/tools/ts-loader.mdx +4 -1
  175. package/docs/zh/configure/app/tools/webpack-chain.mdx +4 -1
  176. package/docs/zh/configure/app/tools/webpack.mdx +4 -1
  177. package/docs/zh/guides/advanced-features/_meta.json +0 -1
  178. package/docs/zh/guides/advanced-features/bff/extend-server.mdx +28 -76
  179. package/docs/zh/guides/advanced-features/bff/frameworks.mdx +6 -66
  180. package/docs/zh/guides/advanced-features/page-performance/_meta.json +1 -1
  181. package/docs/zh/guides/advanced-features/page-performance/react-compiler.mdx +44 -0
  182. package/docs/zh/guides/advanced-features/web-server.mdx +221 -24
  183. package/docs/zh/guides/basic-features/data/data-cache.mdx +1 -1
  184. package/docs/zh/guides/basic-features/deploy.mdx +4 -3
  185. package/docs/zh/guides/basic-features/output-files.mdx +0 -28
  186. package/docs/zh/guides/basic-features/render/ssr.mdx +1 -1
  187. package/docs/zh/guides/basic-features/render/streaming-ssr.mdx +1 -1
  188. package/docs/zh/guides/basic-features/static-assets/wasm-assets.mdx +1 -1
  189. package/docs/zh/guides/topic-detail/module-federation/deploy.mdx +83 -7
  190. package/docs/zh/guides/topic-detail/module-federation/usage.mdx +2 -4
  191. package/docs/zh/plugin/cli-plugins/api.mdx +1 -1
  192. package/docs/zh/tutorials/first-app/c04-routes.mdx +4 -2
  193. package/docs/zh/tutorials/first-app/c05-loader.mdx +4 -1
  194. package/package.json +7 -4
  195. package/rspress.config.ts +16 -1
  196. package/src/components/RsbuildLink/index.tsx +2 -2
  197. package/src/index.ts +1 -5
  198. package/src/pages/index.tsx +3 -3
  199. package/docs/en/apis/app/hooks/api/middleware.mdx +0 -11
  200. package/docs/en/apis/app/runtime/bff/hook.mdx +0 -44
  201. package/docs/en/apis/app/runtime/bff/use-context.mdx +0 -38
  202. package/docs/en/configure/app/bff/enable-handle-web.mdx +0 -24
  203. package/docs/en/guides/advanced-features/custom-server.mdx +0 -218
  204. package/docs/zh/apis/app/hooks/api/middleware.mdx +0 -11
  205. package/docs/zh/apis/app/runtime/bff/hook.mdx +0 -44
  206. package/docs/zh/apis/app/runtime/bff/use-context.mdx +0 -38
  207. package/docs/zh/configure/app/bff/enable-handle-web.mdx +0 -24
  208. package/docs/zh/guides/advanced-features/custom-server.mdx +0 -216
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: modern.server.[tj]s
3
+ sidebar_position: 1
4
+ ---
5
+
6
+ # modern.server.[tj]s
7
+
8
+ This file extends the Modern.js Server. In this file, you can configure [Middleware](/guides/advanced-features/web-server.html#middleware), [RenderMiddleware](/guides/advanced-features/web-server.html#rendermiddleware), or [Plugin](/guides/advanced-features/web-server.html#plugin) for the Server that starts with the Modern.js project.
9
+
10
+ You can intercept and handle requests and responses, perform authentication and role checks, preprocess requests, and handle exceptions, etc. You can also insert specific business logic into the built-in processing logic (including route matching, resource addressing, header injection, page rendering, and static web hosting).
@@ -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 {3,4}
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
@@ -88,73 +88,3 @@ export default () => {
88
88
  `<Outlet>` is a new API in React Router 6. For details, see [Outlet](https://reactrouter.com/en/main/components/outlet#outlet).
89
89
 
90
90
  :::
91
-
92
- ## Upgrading to React Router v7
93
-
94
- React Router v7 reduces bundle size (approximately 15% smaller) compared to React Router v6, provides a more efficient route matching algorithm, and offers better support for React 19 and TypeScript. There are very few breaking changes compared to React Router v6, and Modern.js has made both versions compatible, allowing for a seamless upgrade by simply installing and registering the appropriate plugin.
95
-
96
- :::info
97
-
98
- For more changes from React Router v6 to React Router v7, check the [documentation](https://reactrouter.com/upgrading/v6#upgrade-to-v7)
99
-
100
- :::
101
-
102
- ### Requirements
103
-
104
- React Router v7 has certain environment requirements:
105
-
106
- - Node.js 20+
107
- - React 18+
108
- - React DOM 18+
109
-
110
- ### Install the Plugin
111
-
112
- First, install the Modern.js React Router v7 plugin:
113
-
114
- ```bash
115
- pnpm add @modern-js/plugin-router-v7
116
- ```
117
-
118
- ### Configure the Plugin
119
-
120
- Register the plugin in `modern.config.ts`:
121
-
122
- ```ts title="modern.config.ts"
123
- import { routerPlugin } from '@modern-js/plugin-router-v7';
124
-
125
- export default {
126
- runtime: {
127
- router: true,
128
- },
129
- plugins: [routerPlugin()],
130
- };
131
- ```
132
-
133
- ### Code Changes
134
-
135
- In React Router v7, you no longer need to use the `defer` API; you can directly return data in the data loader:
136
-
137
- ```ts title="routes/page.data.ts"
138
- import { defer } from '@modern-js/runtime/router';
139
-
140
- export const loader = async ({ params }) => {
141
- // Recommended v7 style
142
- const user = fetchUser(params.id)
143
- return { user };
144
-
145
- // v6 style, still compatible with Modern.js
146
- return defer({ data: 'hello' });
147
- };
148
- ```
149
-
150
- React Router v7 has also deprecated the `json` API:
151
-
152
- ```ts title="routes/page.data.ts"
153
- export const loader = async ({ params }) => {
154
- // Recommended v7 style
155
- return { data: 'hello' };
156
-
157
- // v6 style, still compatible with Modern.js
158
- return json({ data: 'hello' });
159
- };
160
- ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: useHonoContext
3
+ ---
4
+ # useHonoContext
5
+
6
+ Used to obtain Hono context in an integrated BFF function.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { useHonoContext } from '@modern-js/plugin-bff/hono';
12
+ ```
13
+
14
+ ## Function Signature
15
+
16
+ `function useHonoContext(): Context`
17
+
18
+ ## Example
19
+
20
+ Developers can use `context` to obtain more request information, such as setting response headers:
21
+
22
+ ```ts
23
+ import { useHonoContext } from '@modern-js/plugin-bff/hono';
24
+
25
+ export async function get() {
26
+ const c = useHonoContext();
27
+ c.res.headers.set('x-bff-api', 'true');
28
+ // ...
29
+ }
30
+ ```
@@ -9,40 +9,14 @@ import { PackageManagerTabs } from '@theme';
9
9
  ```bash
10
10
  ? Please select the operation you want to perform Enable optional features
11
11
  ? Please select the feature to enable Enable "BFF"
12
- ? Please select BFF type Framework mode
13
12
  ```
14
13
 
15
- :::note
16
- Currently, it is recommended to create BFF in framework mode. We will remove the BFF type concept in the future.
17
- :::
18
-
19
14
  3. Depending on the chosen runtime framework, add the following code to `modern.config.[tj]s`:
20
15
 
21
- import { Tabs, Tab as TabItem } from "@theme";
22
-
23
- <Tabs>
24
- <TabItem value="express" label="Express.js" default>
25
-
26
- ```ts title="modern.config.ts"
27
- import { expressPlugin } from '@modern-js/plugin-express';
28
- import { bffPlugin } from '@modern-js/plugin-bff';
29
-
30
- export default defineConfig({
31
- plugins: [expressPlugin(), bffPlugin()],
32
- });
33
- ```
34
-
35
- </TabItem>
36
- <TabItem value="koa" label="Koa.js">
37
-
38
16
  ```ts title="modern.config.ts"
39
- import { koaPlugin } from '@modern-js/plugin-koa';
40
17
  import { bffPlugin } from '@modern-js/plugin-bff';
41
18
 
42
19
  export default defineConfig({
43
- plugins: [koaPlugin(), bffPlugin()],
20
+ plugins: [bffPlugin()],
44
21
  });
45
22
  ```
46
-
47
- </TabItem>
48
- </Tabs>
@@ -1,5 +1,5 @@
1
- import RsbuildLInk from '@site/src/components/RsbuildLink';
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 <RsbuildLInk configName={frontmatter.configName}/>.
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 +1 @@
1
- Modern.js supports [Express.js](https://expressjs.com/) and [Koa.js](https://koajs.com/) as optional BFF runtime frameworks. Please refer to the [BFF - Frameworks](/guides/advanced-features/bff/frameworks.html) for more information.
1
+ Modern.js Server and BFF use [Hono.js](https://hono.dev/) as the runtime framework, and you can extend the Server based on the Hono.js ecosystem. Please refer to [Custom Web Server](/guides/advanced-features/web-server.html).
@@ -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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
43
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
45
44
 
46
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
21
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
23
22
 
24
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
52
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
54
53
 
55
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
29
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
31
30
 
32
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
52
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
54
53
 
55
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
18
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
20
19
 
21
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
26
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
28
27
 
29
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
17
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
19
18
 
20
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
35
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
37
36
 
38
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
20
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
22
21
 
23
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
16
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
18
17
 
19
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
50
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
52
51
 
53
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
28
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
30
29
 
31
- <RsbuildConig />
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
  Set the directory of the dist files. Modern.js will output files to the corresponding subdirectory according to the file type.
45
43
 
46
- import RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
44
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
47
45
 
48
- <RsbuildConig />
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
  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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
22
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
24
23
 
25
- <RsbuildConig />
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 RsbuildConig from '@site-docs-en/components/rsbuild-config-tooltip';
12
+ import RsbuildConfig from '@site-docs-en/components/rsbuild-config-tooltip';
14
13
 
15
- <RsbuildConig />
14
+ <RsbuildConfig configName="output.filenameHash" />