-
-
Notifications
You must be signed in to change notification settings - Fork 386
Allow defining which chunks will be loaded dynamically #57
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
Comments
All this chunking is getting so complicated. Could the new |
@garygreen I think in the ideal case this plugin wouldn't be needed. I hope webpack 5 simplifies this. I had to implement the code above by necessity. 👍 |
@bebraw so were are already waiting for Webpack 5 to solve things that Webpack 4 didn't address 😜 . Thanks for the example, I've resorted to using |
@dtothefp I have a SSR use case too. First I write a manifest through my extension and then use it to write critical CSS inline to initial HTML. This works well. |
@bebraw that sounds cool and similar to what I’m doing. How do you prevent the request for the chunked CSS that you’ve already unlined? Your plugin looks cool but I was hoping to do this with he mini-css-extract-plugin as I thought it was going to be the maintained solution moving forward. |
@dtothefp @sokra added this a day or two ago https://github.com/webpack-contrib/mini-css-extract-plugin#using-preloaded-or-inlined-css |
@KyleAMathews thanks for the heads up on this....it works great. Only problem is to get it to work I need to compile the |
Today will be release, also with fix incremental problem. |
It's released, but the incremental problem is not fixed yet, as it required fixes to webpack too. |
Regarding the original issue. This plugin just enables webpack to use CSS in chunks. You can use the usual webpack plugins/options to modify the chunk graph. i. e. |
Inlining could be a html-webpack-plugin -plugin. I guess there is already one. |
It would be useful to have means to define which chunks are loaded dynamically and which are not. I did a small implementation that allows this:
I'm not sure of the naming but basically this does the trick for me. I write a manifest which I use later to inline the CSS but you could easily write a CSS file through webpack here as well. You can find my code here.
Let me know if you want a PR.
The text was updated successfully, but these errors were encountered: