From c74e8f38780a39edb0ca81f2c4a0beecb52ab625 Mon Sep 17 00:00:00 2001 From: Vasilii A <3757319+vsn4ik@users.noreply.github.com> Date: Sun, 15 Sep 2024 12:34:26 +0000 Subject: [PATCH] docs(configuration): module rule.compiler ident fix --- src/content/configuration/experiments.mdx | 59 +++++++++++------------ src/content/configuration/module.mdx | 24 ++++----- 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/src/content/configuration/experiments.mdx b/src/content/configuration/experiments.mdx index c4263f737548..2f893988059d 100644 --- a/src/content/configuration/experiments.mdx +++ b/src/content/configuration/experiments.mdx @@ -235,37 +235,36 @@ Compile entrypoints and dynamic `import`s only when they are in use. It can be u ```ts { - // define a custom backend - backend?: (( - compiler: Compiler, - callback: (err?: Error, api?: BackendApi) => void + // define a custom backend + backend?: (( + compiler: Compiler, + callback: (err?: Error, api?: BackendApi) => void ) => void) - | ((compiler: Compiler) => Promise) - | { - /** - * A custom client. - */ - client?: string; - - /** - * Specify where to listen to from the server. - */ - listen?: number | ListenOptions | ((server: Server) => void); - - /** - * Specify the protocol the client should use to connect to the server. - */ - protocol?: "http" | "https"; - - /** - * Specify how to create the server handling the EventSource requests. - */ - server?: ServerOptionsImport | ServerOptionsHttps | (() => Server); - - }, - entries?: boolean, - imports?: boolean, - test?: string | RegExp | ((module: Module) => boolean) + | ((compiler: Compiler) => Promise) + | { + /** + * A custom client. + */ + client?: string; + + /** + * Specify where to listen to from the server. + */ + listen?: number | ListenOptions | ((server: Server) => void); + + /** + * Specify the protocol the client should use to connect to the server. + */ + protocol?: "http" | "https"; + + /** + * Specify how to create the server handling the EventSource requests. + */ + server?: ServerOptionsImport | ServerOptionsHttps | (() => Server); + }, + entries?: boolean, + imports?: boolean, + test?: string | RegExp | ((module: Module) => boolean) } ``` diff --git a/src/content/configuration/module.mdx b/src/content/configuration/module.mdx index e3cb236451c5..17fd3e33e7f5 100644 --- a/src/content/configuration/module.mdx +++ b/src/content/configuration/module.mdx @@ -760,20 +760,20 @@ A [`Condition`](#condition) that allows you to match the child compiler name. ```javascript module.exports = { // ... - name: "compiler" + name: 'compiler', module: { rules: [ - { - test: /a\.js$/, - compiler: "compiler", // Matches the "compiler" name, loader will be applied - use: "./loader" - }, - { - test: /b\.js$/, - compiler: "other-compiler", // Does not match the "compiler" name, loader will NOT be applied - use: "./loader" - } - ] + { + test: /a\.js$/, + compiler: 'compiler', // Matches the "compiler" name, loader will be applied + use: './loader', + }, + { + test: /b\.js$/, + compiler: 'other-compiler', // Does not match the "compiler" name, loader will NOT be applied + use: './loader', + }, + ], }, }; ```