Skip to content

Commit

Permalink
docs: add Rspack config validation to migration guide (#3309)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 29, 2024
1 parent 5f53de5 commit 8a79ff6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions website/docs/en/guide/migration/rsbuild-0-x.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ export default {
};
```

## [Important] Rspack Config Validation

Rsbuild now enables Rspack's scheme validation by default to ensure the Rspack configuration is correct.

- If there is a type error in the Rspack config object, an error will be thrown and the build will be aborted.
- If there are extra fields in the Rspack config object, an error will be thrown, but the build will not fail.

> For more details, see [Rspack - RSPACK_CONFIG_VALIDATE](https://rspack.dev/guide/migration/webpack#updating-configuration).
## source.alias

Removed `target` param for `source.alias` function, use [environments](/config/environments) config instead.
Expand Down
12 changes: 11 additions & 1 deletion website/docs/zh/guide/migration/rsbuild-0-x.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ export default {
};
```

## [重要] Rspack 配置校验

Rsbuild 现在默认启用 Rspack 的 scheme 校验,以确保 Rspack 配置的正确性。

- 当 Rspack 配置的类型错误时,会抛出错误并终止构建。
- 当 Rspack 配置中存在多余的字段时,会抛出错误,但不会终止构建。

> 详见 [Rspack - RSPACK_CONFIG_VALIDATE](https://rspack.dev/guide/migration/webpack#updating-configuration)
## source.alias

移除 `source.alias` 函数的 `target` 参数,改用 [environments](/config/environments) 配置。
Expand Down Expand Up @@ -334,7 +343,8 @@ export default {

```diff
export default {
dev: {
- dev: {
+ server: {
- startUrl: true,
+ open: true,
}
Expand Down

0 comments on commit 8a79ff6

Please sign in to comment.