-
Notifications
You must be signed in to change notification settings - Fork 125
[Question]Why happypack load css by async? #202
Comments
I'm fairly certain this isn't on happypack's end since this is runtime behaviour. The only thing that could be going on is that happypack isn't passing the loader options that you intend, which doesn't seem to be the case here either. I believe this is because of your use of ExtractTextPlugin - You have two options:
For the first, there's the example and this comment that may help you out. It may be a hit-or-miss thing; it works for some people and doesn't for others, so try it and see. Something like this possibly: use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'happypack/loader?id=happypack-devclient-css'
],
}) Let me know if that helps! Please update us when you get around to it. |
Thanks for your reply. It seems that this is
The css still be load as async. after html loaded: a few seconds, after style loaded: And your workaround below also can't solve this:
it will throw And by the way, before I often used @amireh Do you have any thoughts about this? :) |
open sourcemap
close sourcemap
At first, when the browser download the html, there is no style tag in the head tag, so the screen just has plain html, after a few seconds, it add style to the head tag(i.e. asynchronous)
but if I don't use happypack(like below) in the
module.rules
, the css won't be load as async`So the question is, use happypack delay the time of first paint, which is a little annoying, and cause us can't use performance panel of chrome devtools(because the render process is not correct). And how to solve this, thanks :)
The text was updated successfully, but these errors were encountered: