-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
Adding new css import doesn't result in hot style update #706
Comments
I can reproduce this bug with latest version of webpack and this plugin. @alexander-akait |
Feel free to send a fix, we should accept a new module |
@alexander-akait After some investigation, I found that #726 might be the best solution for this bug. After inserting a new module, we should perform a HMR update, similar to how we do with the dispose handler. |
@latin-1 it will reload CSS very often..., anyway can you create reproducible repo with such fix, I will look |
@alexander-akait What about this one?
|
https://github.com/latin-1/mini-css-extract-plugin-706-repro |
@alexander-akait Hi, could you please take a look into #1006? |
14.2.0
6.14.4
5.23.0
1.3.8
Expected Behavior
When adding new
.css
import with HMR enabled styles should hot update.Actual Behavior
Styles are not hot updated. I get:
But no logs that are usually printed when styles reload - from
mini-css-extract-plugin/src/hmr/hotModuleReplacement.js
Lines 230 to 236 in 470ba0e
When I save any
.css
file (can be just resave without any change), only then this newly imported styles are applied:Code
Code in reproduction 👇
But from what I can tell when new css Module (not css-modules, just webpack module :) ). Is loaded this code gets executed -
mini-css-extract-plugin/src/loader.js
Lines 11 to 30 in 470ba0e
But this code only setup
cssReload
function to be executed on next hot update. It doesn't execute it when new module is added for the first time. I guess it might be tricky to potentially execute it only when new module is added, but not on initial code evaluation (first visit in the browser)?How Do We Reproduce?
https://github.com/pieh/mini-css-extract-plugin-new-css-import
steps listed in README
The text was updated successfully, but these errors were encountered: