Skip to content

Commit fa39707

Browse files
authored
docs(configuration): module rule.compiler ident fix (#7394)
1 parent 9b0f960 commit fa39707

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

src/content/configuration/experiments.mdx

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -235,37 +235,36 @@ Compile entrypoints and dynamic `import`s only when they are in use. It can be u
235235

236236
```ts
237237
{
238-
// define a custom backend
239-
backend?: ((
240-
compiler: Compiler,
241-
callback: (err?: Error, api?: BackendApi) => void
238+
// define a custom backend
239+
backend?: ((
240+
compiler: Compiler,
241+
callback: (err?: Error, api?: BackendApi) => void
242242
) => void)
243-
| ((compiler: Compiler) => Promise<BackendApi>)
244-
| {
245-
/**
246-
* A custom client.
247-
*/
248-
client?: string;
249-
250-
/**
251-
* Specify where to listen to from the server.
252-
*/
253-
listen?: number | ListenOptions | ((server: Server) => void);
254-
255-
/**
256-
* Specify the protocol the client should use to connect to the server.
257-
*/
258-
protocol?: "http" | "https";
259-
260-
/**
261-
* Specify how to create the server handling the EventSource requests.
262-
*/
263-
server?: ServerOptionsImport | ServerOptionsHttps | (() => Server);
264-
265-
},
266-
entries?: boolean,
267-
imports?: boolean,
268-
test?: string | RegExp | ((module: Module) => boolean)
243+
| ((compiler: Compiler) => Promise<BackendApi>)
244+
| {
245+
/**
246+
* A custom client.
247+
*/
248+
client?: string;
249+
250+
/**
251+
* Specify where to listen to from the server.
252+
*/
253+
listen?: number | ListenOptions | ((server: Server) => void);
254+
255+
/**
256+
* Specify the protocol the client should use to connect to the server.
257+
*/
258+
protocol?: "http" | "https";
259+
260+
/**
261+
* Specify how to create the server handling the EventSource requests.
262+
*/
263+
server?: ServerOptionsImport | ServerOptionsHttps | (() => Server);
264+
},
265+
entries?: boolean,
266+
imports?: boolean,
267+
test?: string | RegExp | ((module: Module) => boolean)
269268
}
270269
```
271270

src/content/configuration/module.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -760,20 +760,20 @@ A [`Condition`](#condition) that allows you to match the child compiler name.
760760
```javascript
761761
module.exports = {
762762
// ...
763-
name: "compiler"
763+
name: 'compiler',
764764
module: {
765765
rules: [
766-
{
767-
test: /a\.js$/,
768-
compiler: "compiler", // Matches the "compiler" name, loader will be applied
769-
use: "./loader"
770-
},
771-
{
772-
test: /b\.js$/,
773-
compiler: "other-compiler", // Does not match the "compiler" name, loader will NOT be applied
774-
use: "./loader"
775-
}
776-
]
766+
{
767+
test: /a\.js$/,
768+
compiler: 'compiler', // Matches the "compiler" name, loader will be applied
769+
use: './loader',
770+
},
771+
{
772+
test: /b\.js$/,
773+
compiler: 'other-compiler', // Does not match the "compiler" name, loader will NOT be applied
774+
use: './loader',
775+
},
776+
],
777777
},
778778
};
779779
```

0 commit comments

Comments
 (0)