Skip to content

Commit 705a160

Browse files
committed
Merge branch 'main' into blog_2.0_0410
2 parents 410663a + 3baa995 commit 705a160

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

website/docs/en/config/module-federation/options.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
description: "Used to configure the Rspack's Module Federation plugin (Module Federation v1.5)."
33
---
44

5+
import { PackageManagerTabs } from '@theme';
6+
57
# moduleFederation.options
68

79
- **Type:** [Rspack.ModuleFederationPluginOptions](https://rspack.rs/plugins/webpack/module-federation-plugin#options)
@@ -38,7 +40,11 @@ export default defineConfig({
3840
});
3941
```
4042

41-
Please refer to the [ModuleFederationPlugin](https://rspack.rs/plugins/webpack/module-federation-plugin) document for all available options.
43+
This option depends on the runtime package [@module-federation/runtime-tools](https://www.npmjs.com/package/@module-federation/runtime-tools), which provides runtime support for Module Federation. Install it first:
44+
45+
<PackageManagerTabs command="add @module-federation/runtime-tools" />
46+
47+
> Refer to the [ModuleFederationPlugin](https://rspack.rs/plugins/webpack/module-federation-plugin) document for all available options.
4248
4349
## Example
4450

website/docs/en/guide/upgrade/v1-to-v2.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,24 @@ Rsbuild 2.0 requires Node.js 20.19+ or 22.12+, Node.js 18 is no longer supported
101101

102102
[@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) is now published as a pure ESM package.
103103

104-
## Polyfill dependency change
104+
## Dependency changes
105105

106-
[core-js](https://www.npmjs.com/package/core-js) has been changed from a default dependency of `@rsbuild/core` to an optional peer dependency, which reduces the installation size by 1.2 MB.
106+
### Polyfill
107+
108+
[core-js](https://www.npmjs.com/package/core-js) polyfill has been changed from a default dependency of `@rsbuild/core` to an optional peer dependency, which reduces the installation size by 1.2 MB.
107109

108110
If you enabled [output.polyfill](/config/output/polyfill), install `core-js` v3 in your project:
109111

110112
<PackageManagerTabs command="add core-js" />
111113

114+
### Module Federation
115+
116+
If you use the [moduleFederation.options](/config/module-federation/options) option, install [@module-federation/runtime-tools](https://www.npmjs.com/package/@module-federation/runtime-tools) manually in your project, it is an optional peer dependency of `@rspack/core`:
117+
118+
<PackageManagerTabs command="add @module-federation/runtime-tools" />
119+
120+
This change only affects projects that use Module Federation v1.5 through `moduleFederation.options`. If you are using Module Federation v2, no action is required.
121+
112122
## Configuration
113123

114124
### Default server host

website/docs/zh/config/module-federation/options.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
description: '用于配置 Rspack 模块联邦插件(对应模块联邦 v1.5)。'
33
---
44

5+
import { PackageManagerTabs } from '@theme';
6+
57
# moduleFederation.options
68

79
- **类型:** [Rspack.ModuleFederationPluginOptions](https://rspack.rs/zh/plugins/webpack/module-federation-plugin#options)
@@ -38,7 +40,11 @@ export default defineConfig({
3840
});
3941
```
4042

41-
请参考 [ModuleFederationPlugin](https://rspack.rs/zh/plugins/webpack/module-federation-plugin) 文档来了解所有可用的选项。
43+
该选项依赖运行时包 [@module-federation/runtime-tools](https://www.npmjs.com/package/@module-federation/runtime-tools),用于提供模块联邦的运行时支持。请先安装该依赖:
44+
45+
<PackageManagerTabs command="add @module-federation/runtime-tools" />
46+
47+
> 参考 [ModuleFederationPlugin](https://rspack.rs/zh/plugins/webpack/module-federation-plugin) 文档来了解所有可用的选项。
4248
4349
## 示例
4450

website/docs/zh/guide/upgrade/v1-to-v2.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,24 @@ Rsbuild 2.0 最低支持的 Node.js 版本为 20.19+ 或 22.12+,不再支持 N
101101

102102
[@rsbuild/core](https://www.npmjs.com/package/@rsbuild/core) 现已以 pure ESM 包的形式发布。
103103

104-
## Polyfill 依赖变更
104+
## 依赖变更
105105

106-
[core-js](https://www.npmjs.com/package/core-js)`@rsbuild/core` 的默认依赖变更为可选的 peer 依赖,这减少了 1.2MB 的安装体积。
106+
### Polyfill
107+
108+
[core-js](https://www.npmjs.com/package/core-js) polyfill 从 `@rsbuild/core` 的默认依赖变更为可选的 peer 依赖,这减少了 1.2MB 的安装体积。
107109

108110
如果你启用了 [output.polyfill](/config/output/polyfill),请在项目中安装 `core-js` v3:
109111

110112
<PackageManagerTabs command="add core-js" />
111113

114+
### Module Federation
115+
116+
如果你使用了 [moduleFederation.options](/config/module-federation/options) 选项,请在项目中手动安装 [@module-federation/runtime-tools](https://www.npmjs.com/package/@module-federation/runtime-tools),它现在是 `@rspack/core` 的 optional peer 依赖:
117+
118+
<PackageManagerTabs command="add @module-federation/runtime-tools" />
119+
120+
这一变更仅影响通过 `moduleFederation.options` 使用 Module Federation v1.5 的项目。如果你使用的是 Module Federation v2,则不受影响。
121+
112122
## 配置
113123

114124
### 默认 host 变更

0 commit comments

Comments
 (0)