Documentation is confusing
See original GitHub issueThis plugin looks like it might be really amazing, but I am finding the documentation very confusing. It’s got lots of webpack config examples, but no examples of other files (e.g. JS, HTML). There are a few things that I cannot figure out:
- Is this plugin supposed to insert the styles into the HTML automatically like
style-loader
does? The documentation makes it seems like it’s supposed to, but from testing it doesn’t appear to. - Should we be using
style-loader
at all with this plugin? I think the answer is no? - How do you avoid a FOUC when using this plugin? Can we just add a
<link rel='stylesheet' href='/build/main.css' />
? Or do we have to add this in some circumstances but not others? - Is HMR enabled by default or do I have to specify
options: { hmr: true }
to enable it? - Is it necessary to configure this plugin differently between development and production or is that taken care of automatically?
From what I can work out it seems like you just add <link rel='stylesheet' href='/build/main.css' />
to the HTML, enable HMR for this plugin by passing options: { hmr: NODE_ENV == 'development' }
and then everything works correctly in both development and production. If that’s so, this is absolutely fantastic! But you should really update the documentation to make this much more obvious. Currently it makes it look really complicated like you might still have to juggle multiple configs and mess with style-loader
and maybe add <link>
sometimes but not others. If it’s really as straightforward as I’m hoping, the documentation should be really cut down and start with the minimum working development/production example with HMR (but include HTML and JS code in the example).
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8
Top GitHub Comments
I maintain both. Extract css chunks merged into mini css over a year ago. You can use either one. Modern features come to extract css before they go to mini css. Other than that. They remain the same internally because I pull request code from here to there. Feel free to use either, they look the same because I code new features on this one. Then merge them to mini css 😃
Sorry, but what is
become
mean? Should I stop usingextract-css-chunks-webpack-plugin
? I’m confirming whether I can migrate intomini-css-extract-plugin
painlessly.