Skip to content

docs: add shared.shareScope #2577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/website-new/docs/en/configure/shared.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface SharedConfig {
singleton?: boolean;
requiredVersion?: string;
eager?: boolean;
shareScope?: string;
}
```

Expand Down Expand Up @@ -76,6 +77,14 @@ Whether to immediately load the shared module.

Under normal circumstances, you need to enable lazy entry, and then asynchronously load shared modules on demand. If you want to use shared but do not want to enable lazy entry, you can set `eager` to true.

## shareScope

- Type: `string`
- Required: No
- Default: `'default'`

share scope name, default value is `'default'` .

## FAQ

### When to use shared dependencies
Expand Down
9 changes: 9 additions & 0 deletions apps/website-new/docs/zh/configure/shared.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface SharedConfig {
singleton?: boolean;
requiredVersion?: string;
eager?: boolean;
shareScope?: string;
}
```

Expand Down Expand Up @@ -76,6 +77,14 @@ new ModuleFederationPlugin({

正常情况下,需要开启异步入口,随后按需异步加载 shared 。 若想使用 shared ,但又不想开启异步入口,那么可以设置 `eager` 为 true 。

## shareScope

- 类型:`string`
- 是否必填:否
- 默认值:`'default'`

共享依赖作用域,默认值为 `'default'` 。

## FAQ

### 何时使用共享依赖
Expand Down