Skip to content

Commit def7c84

Browse files
committed
Feat: Ability to disable extract async modules
Add doc
1 parent 8ace35d commit def7c84

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,27 @@ module.exports = {
343343
};
344344
```
345345

346+
#### Disable extracting css from async chunks
347+
348+
You may disable extracting css from async chunks with `disableAsync` option.
349+
350+
```javascript
351+
const miniCssExtractPlugin = new MiniCssExtractPlugin({
352+
disableAsync: true,
353+
});
354+
```
355+
356+
You may also disable extracting async css modules programmatically by passing a function.
357+
358+
```javascript
359+
const miniCssExtractPlugin = new MiniCssExtractPlugin({
360+
disableAsync({ module }) {
361+
// Do whatever you want. Disable by content size for example:
362+
return module.content.length < 10 * 1024;
363+
},
364+
});
365+
```
366+
346367
#### Module Filename Option
347368

348369
With the `moduleFilename` option you can use chunk data to customize the filename. This is particularly useful when dealing with multiple entry points and wanting to get more control out of the filename for a given entry point/chunk. In the example below, we'll use `moduleFilename` to output the generated css into a different directory.

0 commit comments

Comments
 (0)