babel-plugin-css-modules-transform
babel-plugin-css-modules-transform copied to clipboard
reload
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 try to set devMode to true it should disable cache.
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
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.
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...
- Force webpack to still open the scss somehow, whilst ignoring the result.
- Manually trigger babel on any .scss file change.
- 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.