Skip to content

Commit 81517cc

Browse files
committed
feat: ability to disable extract modules, update doc
1 parent 4982afb commit 81517cc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

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

346-
#### Disable extracting css from async chunks
346+
#### Disable Extracting Specified CSS from Chunks
347347

348-
You may disable extracting css from async chunks with `disableAsync` option.
348+
You may disable extracting css from all chunks with `disableExtract` option.
349349

350350
```javascript
351351
const miniCssExtractPlugin = new MiniCssExtractPlugin({
352-
disableAsync: true,
352+
disableExtract: true,
353353
});
354354
```
355355

356-
You may also disable extracting async css modules programmatically by passing a function.
356+
You may also disable extracting css modules programmatically by passing a function.
357357

358358
```javascript
359359
const miniCssExtractPlugin = new MiniCssExtractPlugin({
360-
disableAsync({ module }) {
360+
disableExtract({ module, isAsync }) {
361361
// Do whatever you want. Disable by content size for example:
362-
return module.content.length < 10 * 1024;
362+
// return module.content.length < 10 * 1024;
363+
// Or disable extracting from all async chunks
364+
return isAsync;
363365
},
364366
});
365367
```

0 commit comments

Comments
 (0)