Skip to content

Commit 34de5bb

Browse files
authored
chore: fix docs error (#2927)
1 parent 433fe07 commit 34de5bb

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

apps/website-new/docs/en/plugin/plugins/retry-plugin.mdx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@ Note: Choose either of the two ways to register the build plugin and do not regi
3232

3333
### Method1: Register in the build plugin
3434

35+
```diff
36+
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
37+
import { defineConfig } from '@rsbuild/core';
38+
39+
export default defineConfig({
40+
tools: {
41+
rspack: (config, { appendPlugins }) => {
42+
appendPlugins([
43+
new ModuleFederationPlugin({
44+
...,
45+
+ runtimePlugins: [
46+
+ path.join(__dirname, './src/runtime-plugin/retry.ts'),
47+
+ ],
48+
}),
49+
]);
50+
},
51+
},
52+
});
53+
54+
```
55+
3556
```ts
3657
// ./src/runtime-plugin/retry.ts
3758
import { RetryPlugin } from '@module-federation/retry-plugin';
@@ -59,8 +80,6 @@ export default retryPlugin;
5980

6081
```ts
6182
import {
62-
init,
63-
loadRemote,
6483
RetryPlugin,
6584
} from '@module-federation/retry-plugin';
6685

apps/website-new/docs/zh/plugin/plugins/retry-plugin.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ import { PackageManagerTabs, Tabs, Tab } from '@theme';
2929

3030
### 方式一:构建插件中注册
3131
```diff
32-
import { ModuleFederationPlugin } from '@module-federation/retry-plugin/rspack';
32+
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
3333
import { defineConfig } from '@rsbuild/core';
34-
import { pluginReact } from '@rsbuild/plugin-react';
35-
import path from 'path';
3634

3735
export default defineConfig({
3836
tools: {
@@ -47,7 +45,6 @@ export default defineConfig({
4745
]);
4846
},
4947
},
50-
plugins: [pluginReact()],
5148
});
5249

5350
```

0 commit comments

Comments
 (0)