Skip to content
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

docs(mf): add @module-federation/sdk to FAQ #7669

Merged
merged 1 commit into from
Aug 26, 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: 6 additions & 3 deletions website/docs/en/plugins/webpack/module-federation-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,19 @@ The SharedConfig can include the following sub-options:

## FAQ

- Q: Found there is non-downgraded syntax in the output after usage
- Found non-downgraded syntax in the build output?

A: add `builtin:swc-loader` for downgrading, specifically it should include `@module-federation/runtime/rspack.js`, for example:
If you need to be compatible with legacy browsers, please add [builtin:swc-loader](/guide/features/builtin-swc-loader) for syntax downgrade, and make sure it matches `@module-federation/runtime` and `@module-federation/sdk`. Here is an example:

```js
module.exports = {
module: {
rules: [
{
include: '@module-federation/runtime/rspack.js',
include: [
/@module-federation[\\/]sdk/,
/@module-federation[\\/]runtime/,
],
use: {
loader: 'builtin:swc-loader',
options: {
Expand Down
9 changes: 6 additions & 3 deletions website/docs/zh/plugins/webpack/module-federation-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,19 @@ module.exports = {

## 常见问题

- 使用后发现产物中存在未降级语法
- 构建产物中存在未降级语法?

添加 `builtin:swc-loader` 进行降级,具体需要包含 `@module-federation/runtime/rspack.js`。示例如下:
如果你需要兼容低版本浏览器,请添加 [builtin:swc-loader](/guide/features/builtin-swc-loader) 进行语法降级,需要匹配 `@module-federation/runtime` 和 `@module-federation/sdk`。示例如下:

```js
module.exports = {
module: {
rules: [
{
include: '@module-federation/runtime/rspack.js',
include: [
/@module-federation[\\/]sdk/,
/@module-federation[\\/]runtime/,
],
use: {
loader: 'builtin:swc-loader',
options: {
Expand Down
Loading