Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Disable Extracting Specified CSS Module from Chunks #432

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
39b36e9
feat: ability to disable extract async modules
lsycxyj Jul 20, 2019
188cf5c
feat: ability to disable extract async modules, lint fix
lsycxyj Jul 20, 2019
4a7a1f6
feat: ability to disable extract async modules, add doc
lsycxyj Jul 20, 2019
399aa9a
feat: ability to disable extract async modules, ci fix
lsycxyj Jul 20, 2019
26646ae
feat: ability to disable extract async modules, order fix
lsycxyj Jul 20, 2019
08b8e52
feat: ability to disable extract async modules, wrong initial chunks fix
lsycxyj Jul 21, 2019
775cc0c
feat: ability to disable extract async modules, add manual test
lsycxyj Jul 21, 2019
f9d7df1
feat: ability to disable extract async modules, update lock file
lsycxyj Jul 21, 2019
c38cc8c
feat: ability to disable extract async modules, add tests for js files
lsycxyj Jul 21, 2019
e2177fd
feat: ability to disable extract modules, wip
lsycxyj Jul 22, 2019
4982afb
feat: ability to disable extract modules, remove duplicated dependencies
lsycxyj Jul 24, 2019
81517cc
feat: ability to disable extract modules, update doc
lsycxyj Jul 24, 2019
5b3fbef
feat: ability to disable extract modules, remove boolean type option
lsycxyj Jul 24, 2019
1da949e
feat: ability to disable extract modules, less code difference
lsycxyj Jul 24, 2019
e59a0e1
feat: ability to disable extract modules, less code difference
lsycxyj Jul 24, 2019
37ce619
Merge remote-tracking branch 'origin/feature/disable_async_20190719' …
lsycxyj Jul 24, 2019
6001569
feat: ability to disable extract modules, less regressions
lsycxyj Jul 26, 2019
b986c54
feat: ability to disable extract modules, ci fix
lsycxyj Jul 26, 2019
fa58310
feat: ability to disable extract modules, ci fix
lsycxyj Jul 26, 2019
5de6572
feat: ability to disable extract modules, replace private property
lsycxyj Jul 27, 2019
5b2c6d3
feat: ability to disable extract modules, remove useless code
lsycxyj Jul 31, 2019
2f29038
merge from master WIP
lsycxyj Feb 3, 2020
f0358d0
fix wrong modules after disable extraction
lsycxyj Feb 4, 2020
cbcfbc5
Merge remote-tracking branch 'upstream/master' into feature/disable_a…
lsycxyj Aug 6, 2020
40af212
fix wrong modification and update package-lock.json
lsycxyj Aug 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Expand Up @@ -343,23 +343,25 @@ module.exports = {
};
```

#### Disable extracting css from async chunks
#### Disable Extracting Specified CSS from Chunks

You may disable extracting css from async chunks with `disableAsync` option.
You may disable extracting css from all chunks with `disableExtract` option.

```javascript
const miniCssExtractPlugin = new MiniCssExtractPlugin({
disableAsync: true,
disableExtract: true,
lsycxyj marked this conversation as resolved.
Show resolved Hide resolved
});
```

You may also disable extracting async css modules programmatically by passing a function.
You may also disable extracting css modules programmatically by passing a function.

```javascript
const miniCssExtractPlugin = new MiniCssExtractPlugin({
disableAsync({ module }) {
disableExtract({ module, isAsync }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name it in positive way e.g. should extract

// Do whatever you want. Disable by content size for example:
return module.content.length < 10 * 1024;
// return module.content.length < 10 * 1024;
// Or disable extracting from all async chunks
return isAsync;
},
});
```
Expand Down