Skip to content

Commit

Permalink
docs: simplify tools.rspack examples (#3061)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Jul 29, 2024
1 parent def3013 commit 41e873e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
7 changes: 4 additions & 3 deletions website/docs/en/config/dev/watch-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ For instance, if you want to prevent a rebuild when files in the `node_modules`
```js
export default {
tools: {
rspack: (config) => {
config.watchOptions ??= {};
config.watchOptions.ignored = /node_modules/;
rspack: {
watchOptions: {
ignored: /node_modules/,
},
},
},
};
Expand Down
6 changes: 3 additions & 3 deletions website/docs/en/guide/advanced/module-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';

export default defineConfig({
tools: {
rspack: (config, { appendPlugins }) => {
appendPlugins([
rspack: {
plugins: [
new ModuleFederationPlugin({
name: 'provider',
// other options
}),
]);
],
},
},
});
Expand Down
7 changes: 4 additions & 3 deletions website/docs/zh/config/dev/watch-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ Rsbuild (Rspack) 默认会监听所有构建依赖,当这些文件发生变化
```js
export default {
tools: {
rspack: (config) => {
config.watchOptions ??= {};
config.watchOptions.ignored = /node_modules/;
rspack: {
watchOptions: {
ignored: /node_modules/,
},
},
},
};
Expand Down
6 changes: 3 additions & 3 deletions website/docs/zh/guide/advanced/module-federation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';

export default defineConfig({
tools: {
rspack: (config, { appendPlugins }) => {
appendPlugins([
rspack: {
plugins: [
new ModuleFederationPlugin({
name: 'provider',
// other options
}),
]);
],
},
},
});
Expand Down

0 comments on commit 41e873e

Please sign in to comment.