madyankin / postcss-modules

PostCSS plugin to use CSS Modules everywhere
MIT License
1.59k stars 86 forks source link

Changes to composed modules do not trigger hot reloading in webpack #81

Open DanielHeath opened 6 years ago

DanielHeath commented 6 years ago

I have a webpack setup using postcss-modules.

I have some.css containing .hi { composes: red from './base.css';}, and base.css containing .red {color: red}.

If I make a change to some.css in development, the changes immediately appear on page. However, if I change base.css, the changes don't appear unless I also touch some.css or reload.

I think postcss-modules needs to report the dependency between the files so that webpack will detect that changes should trigger an update.

gaurav5430 commented 4 years ago

Were you able to figure out why this was happening ? any workarounds?

I am observing the same behaviour: Any other change to css results in HMR, but any changes in composes do not trigger HMR. I am not sure if it is due to postcss-modules or css-modules in general

DanielHeath commented 4 years ago

No, I just avoid using it for now.