Closed robertknight closed 6 years ago
Let's do what you mentioned and also split webpack into production and development, whereby production has the react-style-webpack-plugin and development uses injection. I expect injection to speed up everything some more.
Ideally react-style-webpack-plugin should just perform good, but that's currently not the case :(.
This may be fixed in latest (0.13) since switching to the babel loader.
Running
gulp pack
takes 11 seconds on my system, which makes the tweak -> test cycle painfully slow.Hacking the 'test' regex used for .js files so that the JSX transformer and ReactStylePlugin loaders are only applied to react-material and react-style reduces the time to 7 seconds. Turning off source maps reduced this down to 4.
Running
webpack --watch
builds assets/bundle.js much faster but doesn't appear to be updating assets/bundle.css properly. eg. Startingwebpack --watch --progress
(or the gulp equivalent) and then modifying the ReactStyle definitions for a component results in webpack reporting that it updated bundle.js and bundle.css but only bundle.js gets updated - bundle.css has the same SHA-1 sum before and after.