diff --git a/website/docs/en/config/source/transform-import.mdx b/website/docs/en/config/source/transform-import.mdx index 4c57b4e299..2b567ef4c6 100644 --- a/website/docs/en/config/source/transform-import.mdx +++ b/website/docs/en/config/source/transform-import.mdx @@ -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'); }, }, }; diff --git a/website/docs/en/guide/migration/rsbuild-0-x.mdx b/website/docs/en/guide/migration/rsbuild-0-x.mdx index 8c4f5d8a87..36e42ab34b 100644 --- a/website/docs/en/guide/migration/rsbuild-0-x.mdx +++ b/website/docs/en/guide/migration/rsbuild-0-x.mdx @@ -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. diff --git a/website/docs/zh/config/source/transform-import.mdx b/website/docs/zh/config/source/transform-import.mdx index 65616e4d6c..70989bf7e5 100644 --- a/website/docs/zh/config/source/transform-import.mdx +++ b/website/docs/zh/config/source/transform-import.mdx @@ -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'); }, }, }; diff --git a/website/docs/zh/guide/migration/rsbuild-0-x.mdx b/website/docs/zh/guide/migration/rsbuild-0-x.mdx index ec91094237..cb99586056 100644 --- a/website/docs/zh/guide/migration/rsbuild-0-x.mdx +++ b/website/docs/zh/guide/migration/rsbuild-0-x.mdx @@ -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) 配置。 @@ -334,7 +343,8 @@ export default { ```diff export default { - dev: { +- dev: { ++ server: { - startUrl: true, + open: true, }