Skip to content

Commit 611c5af

Browse files
authored
docs: update ts config guide (#11409)
doc: update ts config guide
1 parent ae33a2a commit 611c5af

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

website/docs/en/config/index.mdx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,12 @@ If your JavaScript runtime already natively supports TypeScript, you can use the
8080

8181
For example, Node.js already natively supports TypeScript, you can use the following command to use the Node.js native loader to load the configuration file:
8282

83-
- For Node.js v22.7.0 to v23.5.0, you need to enable the `--experimental-transform-types` flag:
83+
- For Node.js v22.18+ and v24.3+ which support native TypeScript by default, you can run the following command to load the TS config:
8484

8585
```json title="package.json"
8686
{
8787
"scripts": {
88-
"build": "NODE_OPTIONS='--experimental-transform-types' rspack build"
89-
}
90-
}
91-
```
92-
93-
- For Node.js v23.6.0+, the `--experimental-transform-types` flag is no longer required:
94-
95-
```json title="package.json"
96-
{
97-
"scripts": {
98-
"build": "rspack build"
88+
"build": "rspack build --configLoader=native"
9989
}
10090
}
10191
```

website/docs/zh/config/index.mdx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,12 @@ Rspack 支持以下配置文件格式:
8080

8181
例如,Node.js 已经原生支持 TypeScript,你可以使用以下命令来使用 Node.js 原生加载器来加载配置文件:
8282

83-
- 对于 Node.js v22.7.0 到 v23.5.0,你需要启用 `--experimental-transform-types` 选项
83+
- 对于原生支持 TypeScript 的 Node.js v22.18+ 和 v24.3+,你可以运行以下命令来加载 TS 配置
8484

8585
```json title="package.json"
8686
{
8787
"scripts": {
88-
"build": "NODE_OPTIONS='--experimental-transform-types' rspack build"
89-
}
90-
}
91-
```
92-
93-
- 对于 Node.js v23.6.0+,不再需要 `--experimental-transform-types` 选项:
94-
95-
```json title="package.json"
96-
{
97-
"scripts": {
98-
"build": "rspack build"
88+
"build": "rspack build --configLoader=native"
9989
}
10090
}
10191
```

0 commit comments

Comments
 (0)