Skip to content

Commit

Permalink
docs: update moduleFederation configuration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xusd320 committed Feb 25, 2025
1 parent 1f155ad commit 29f5e60
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,3 +874,33 @@ e.g. If you want to ignore the `foo` directory under root directory, you can set

Whether to write the build result to disk when mode is development.

### moduleFederation

- Type: `{ name: string; filename?: string; exposes?: object; shared?: object; remotes?: object; runtimePlugins?: string[]; shareScope?: string; shareStrategy?: 'version-first' | 'loaded-first';}`
- Default: `undefined`

[Module federation](https://module-federation.io/configure/index.html) configuration. For example:
```json
{
"moduleFederation": {
"name": "remote",
"filename": "remoteEntry.js",
"exposes": {
"./App": "./src/App.tsx"
},
"shared": { "react": {}, "react-dom": {} },
"manifest": true
}
}
```
```json
{
"moduleFederation": {
"name": "host",
"remotes": {
"producer": "producer@http://localhost:3000/remoteEntry.js"
},
"shared": { "react": { "eager": true }, "react-dom": { "eager": true } },
"manifest": true
}
}
30 changes: 30 additions & 0 deletions docs/config.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -869,3 +869,33 @@ babel-plugin-import 的简化版本,仅支持三个配置项:libraryName,l

是否在开发模式下将构建结果写入磁盘。

### moduleFederation

- Type: `{ name: string; filename?: string; exposes?: object; shared?: object; remotes?: object; runtimePlugins?: string[]; shareScope?: string; shareStrategy?: 'version-first' | 'loaded-first';}`
- Default: `undefined`

[Module federation](https://module-federation.io/configure/index.html) 配置. 示例:
```json
{
"moduleFederation": {
"name": "remote",
"filename": "remoteEntry.js",
"exposes": {
"./App": "./src/App.tsx"
},
"shared": { "react": {}, "react-dom": {} },
"manifest": true
}
}
```
```json
{
"moduleFederation": {
"name": "host",
"remotes": {
"remote": "remote@http://localhost:3000/remoteEntry.js"
},
"shared": { "react": { "eager": true }, "react-dom": { "eager": true } },
"manifest": true
}
}

0 comments on commit 29f5e60

Please sign in to comment.