Skip to content

Commit

Permalink
Merge branch 'main' into renovate/rspack
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Aug 29, 2024
2 parents 8a1808f + acb9015 commit c29d96f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion website/docs/en/config/source/transform-import.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ The `transformImport` can be a function, it will accept the previous value, and
export default {
source: {
transformImport: (imports) => {
return imports.filter(import => import.libraryName !== 'antd');
return imports.filter((data) => data.libraryName !== 'antd');
},
},
};
Expand Down
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
2 changes: 1 addition & 1 deletion website/docs/zh/config/source/transform-import.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default {
export default {
source: {
transformImport: (imports) => {
return imports.filter(import => import.libraryName !== 'antd');
return imports.filter((data) => data.libraryName !== 'antd');
},
},
};
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 c29d96f

Please sign in to comment.