babel-plugin-css-modules-transform icon indicating copy to clipboard operation
babel-plugin-css-modules-transform copied to clipboard

reload

Open rmsheppard opened this issue 7 years ago • 4 comments

I have this set up and working in my project. However, it only is able to execute on initial compile. Is there any way to run this upon hot module reload?

rmsheppard avatar Feb 14 '18 06:02 rmsheppard

@rmsheppard try to set devMode to true it should disable cache.

michalkvasnicak avatar Mar 01 '18 13:03 michalkvasnicak

I'm not entirely sure the caching functionality is working as expected. Subsequent executions seem to result in the output of extractCss being a blank file when no changes are found. The way I have currently got around this is to prepend BABEL_DISABLE_CACHE=1 to the start of my executing script

EDIT: I see this is tracked in #45

benedfit avatar Jul 18 '18 11:07 benedfit

I've set devMode to true and have extractCss specified. I'm running babel with the --watch flag, but my extractCss file doesn't update.

petermikitsh avatar Oct 18 '18 04:10 petermikitsh

It's been a while since the last post, but I've got the same issue, and I think I might have an idea. I'm using module.scss files btw, but it should be the same.

The reason that webpack watch doesn't get re-triggered seems to be that webpack doesn't know about the scss file. Babel effectively strips out the scss file and replaces it with the inline class references, and webpack doesn't even parse the scss file.

As far as webpack knows, these files do not exist.

I'm thinking...

  1. Force webpack to still open the scss somehow, whilst ignoring the result.
  2. Manually trigger babel on any .scss file change.
  3. Force webpack to monitor any .scss files.

If anyone knows how to do any of the above, that might help me.

Some context. I'm making an express MVC app that uses React as a view-engine with no client side javascript at all. I still want Sass modules, as it makes managing code easier.

neilsutcliffe avatar Apr 14 '19 20:04 neilsutcliffe