postcss-modules icon indicating copy to clipboard operation
postcss-modules copied to clipboard

Changes to composed modules do not trigger hot reloading in webpack

Open DanielHeath opened this issue 7 years ago • 2 comments

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.

DanielHeath avatar Jul 02 '18 02:07 DanielHeath

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

gaurav5430 avatar Jul 13 '20 04:07 gaurav5430

No, I just avoid using it for now.

DanielHeath avatar Jul 13 '20 04:07 DanielHeath