Skip to content

Commit

Permalink
docs: update MF guides to @module-federation/rsbuild-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Nov 29, 2024
1 parent 648d789 commit 00247c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
20 changes: 8 additions & 12 deletions website/docs/en/guide/advanced/module-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,22 @@ Here are the characteristics of several versions:

[Module Federation 2.0](https://module-federation.io/blog/announcement.html) provides some additional out-of-the-box features based on Module Federation, such as dynamic TS type hints, Chrome devtools, Runtime plugins, preloading, making Module Federation more suitable for micro-frontend architecture supporting large-scale Web applications. Module Federation v2.0 is implemented based on v1.5.

You need to install the additional `@module-federation/enhanced` plugin to use Module Federation v2.0.
You need to install the additional [@module-federation/rsbuild-plugin](https://www.npmjs.com/package/@module-federation/rsbuild-plugin) plugin to use Module Federation v2.0.

```ts title="rsbuild.config.ts"
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';

export default defineConfig({
tools: {
rspack: {
plugins: [
new ModuleFederationPlugin({
name: 'provider',
// other options
}),
],
},
plugins: {
pluginModuleFederation({
name: 'remote',
// other options
}),
},
});
```

Please refer to the [Module Federation v2.0 official documentation](https://module-federation.io/) for specific usage details.
Please refer to the [Module Federation v2.0 official documentation](https://module-federation.io/) for detailed usage.

### Module Federation v1.5

Expand Down
18 changes: 7 additions & 11 deletions website/docs/zh/guide/advanced/module-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,17 @@ Module Federation(MF) 目前有多个主要版本,你可以根据你的需

[Module Federation 2.0](https://module-federation.io/blog/announcement.html) 在 Module Federation 的基础上,开箱即用的提供了一些额外的功能,比如动态 TS 类型提示、Chrome devtool、Runtime plugin、预加载,这些功能让 Module Federation 更适用于支持大型 Web 应用的微前端架构,Module Federation v2.0 在 v1.5 的基础上实现。

你需要安装额外的 `@module-federation/enhanced` 插件,才能使用 Module Federation v2.0。
你需要安装额外的 [@module-federation/rsbuild-plugin](https://www.npmjs.com/package/@module-federation/rsbuild-plugin) 插件,才能使用 Module Federation v2.0。

```ts title="rsbuild.config.ts"
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';

export default defineConfig({
tools: {
rspack: {
plugins: [
new ModuleFederationPlugin({
name: 'provider',
// other options
}),
],
},
plugins: {
pluginModuleFederation({
name: 'remote',
// other options
}),
},
});
```
Expand Down

0 comments on commit 00247c5

Please sign in to comment.