Skip to content

Commit 822c881

Browse files
committed
docs(en): fetch all
1 parent d0f87ee commit 822c881

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/content/plugins/mini-css-extract-plugin.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = {
9595
| **[`attributes`](#attributes)** | `{Object}` | `{}` | Adds custom attributes to the `link` tag for [non-initial (async)](/concepts/under-the-hood/#chunks) CSS chunks |
9696
| **[`linkType`](#linktype)** | `{String\|Boolean}` | `text/css` | Allows loading asynchronous chunks with a custom link type |
9797
| **[`runtime`](#runtime)** | `{Boolean}` | `true` | Allows to enable/disable the runtime generation |
98-
| **[`experimentalUseImportModule`](#experimentaluseimportmodule)** | `{Boolean}` | `false` | Use an experimental webpack API to execute modules instead of child compilers |
98+
| **[`experimentalUseImportModule`](#experimentaluseimportmodule)** | `{Boolean}` | `undefined` | Use an experimental webpack API to execute modules instead of child compilers |
9999

100100
#### `filename`
101101

@@ -308,13 +308,16 @@ module.exports = {
308308

309309
#### `experimentalUseImportModule`
310310

311-
Use an experimental webpack API to execute modules instead of child compilers.
311+
Type: `Boolean`
312+
Default: `undefined`
312313

313-
This improves performance and memory usage a lot, but isn't as stable as the normal approach.
314+
Enabled by default if not explicitly enabled (i.e. `true` and `false` allow you to explicitly control this option) and new API is available (at least webpack `5.52.0` is required).
315+
Boolean values are available since version `5.33.2`, but you need to enable `experiments.executeModule` (not required from webpack `5.52.0`).
314316

315-
When combined with `experiments.layers`, this adds a `layer` option to the loader options to specify the layer of the css execution.
317+
Use a new webpack API to execute modules instead of child compilers.
318+
This improves performance and memory usage a lot.
316319

317-
You need to have at least webpack 5.33.2.
320+
When combined with `experiments.layers`, this adds a `layer` option to the loader options to specify the layer of the css execution.
318321

319322
**webpack.config.js**
320323

@@ -324,6 +327,9 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
324327
module.exports = {
325328
plugins: [
326329
new MiniCssExtractPlugin({
330+
// You don't need this for `>= 5.52.0` due to the fact that this is enabled by default
331+
// Required only for `>= 5.33.2 & <= 5.52.0`
332+
// Not avaliable/unsafe for `<= 5.33.2`
327333
experimentalUseImportModule: true,
328334
}),
329335
],

0 commit comments

Comments
 (0)