-
Notifications
You must be signed in to change notification settings - Fork 160
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
2nd build after adding new scss file doesn't refresh css #302
Comments
duplicate of #301 |
@stereokai I don't think this is a duplicate of #301. Looks like they differ on webpack version and extract plugin used. #301's cause was needing to properly handle the CssDependency introduced by mini-css-extract-plugin. This one looks like an issue with hard-source's handling of its enhanced-resolver cache. It doesn't seem to be seeing the new version of This issue may be compounded by webpack's unsafe cache which does not notice these cases and opts fully to not notice changes instead depending on the user to restart webpack so the cache runs with a new cache. (hard-source doesn't save this cache, so it should be empty every run of webpack, but it does not empty on rebuilds in webpack-dev-server for example). |
I'm sorry, I missed these facts. What a spaghetti of challenges. isn't EnhancedResolverCache introduced in the latest release though? This issue is from March |
I know right. The invalidations used to be more connected in hard-source. 0.6 helped disconnect those a bunch. (And 0.5's plugins helped make 0.6 possible) All of the Caches in 0.7 existed in an earlier form in 0.6 and most of them even earlier in other versions. 0.7 is where I've been able to break them out into their own classes and files. EnhancedResolverCache was added in 0.4. The change log referred to it as the |
Heh. You can see a bit where the 0.7 Caches came from. |
Ah. This sounds like an issue with NormalModule's fileDependencies. I don't think webpack itself would handle this case unless hard-source supports adding a new module that should replace another module at a different file path. It does not support that module depending on an additional file that is replaced by another file appearing earlier in the resolver configuration. This will need some thought to figure out how we can support it. |
Now that's what I'd call a refactor! |
Steps to reproduce:
(the scss file is imported with ~filename in the root scss file, to make webpack resolves this)
-> the new scss file is ignored and no new css is generated
(cleaning the cache of hard-source-webpack-plugin before resolves the problem)
webpack.config:
main.scss
@import "~body";
body.scss
custom\body.scss
The text was updated successfully, but these errors were encountered: