Skip to content

Commit 588e612

Browse files
committed
docs: clarify preserve runtime requirements
1 parent 234bdcd commit 588e612

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

website/docs/en/guide/solution/react.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ export default defineConfig({
7676
});
7777
```
7878

79-
When you need to keep native JSX in the build output, set the runtime to `'preserve'`. This mode retains JSX syntax so it can be processed later (for example by another bundler). Because the files stay unbundled, you must switch to bundleless mode by setting `bundle: false`.
79+
When you need to keep native JSX in the build output, set the runtime to `'preserve'`. This mode retains JSX syntax so it can be processed later (for example by another bundler).
8080

81-
To emit `.jsx` files, configure the JS filename template while using the preserve runtime:
81+
::: warn
82+
83+
Because the files stay unbundled, you must switch to bundleless mode by setting `bundle: false`.
84+
85+
:::
86+
87+
To emit `.jsx` files, configure the JS filename template through [output.filename](/config/rsbuild/output#outputfilename) while using the preserve runtime:
8288

8389
```ts title="rslib.config.ts" twoslash
8490
import { pluginReact } from '@rsbuild/plugin-react';

website/docs/zh/guide/solution/react.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ export default defineConfig({
7676
});
7777
```
7878

79-
当你希望在构建产物中保留原始 JSX 时,可以将 runtime 设置为 `'preserve'`。该模式会保留 JSX 语法,方便后续由其他打包工具处理。因为文件保持非打包状态,所以必须通过将 `bundle` 设为 `false` 启用 bundleless 模式。
79+
当你希望在构建产物中保留原始 JSX 时,可以将 runtime 设置为 `'preserve'`。该模式会保留 JSX 语法,方便后续由其他打包工具处理。
8080

81-
若要输出 `.jsx` 后缀的文件,可在使用 preserve runtime 时配置 JS 文件名模版:
81+
::: warn
82+
83+
因为文件保持非打包状态,所以必须通过将 `bundle` 设为 `false` 启用 bundleless 模式。
84+
85+
:::
86+
87+
若要输出 `.jsx` 后缀的文件,可通过 [output.filename](/config/rsbuild/output#outputfilename) 配置 JS 文件名模版:
8288

8389
```ts title="rslib.config.ts" twoslash
8490
import { pluginReact } from '@rsbuild/plugin-react';

0 commit comments

Comments
 (0)