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: simplify tools.rspack examples #3061

Merged
merged 1 commit into from
Jul 29, 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
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
Loading