BerkeleyTrue / react-material

Material design components written with React.js and React Style
http://berkeleytrue.github.io/react-material
404 stars 38 forks source link

Slow webpack build #67

Closed robertknight closed 6 years ago

robertknight commented 9 years ago

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. Starting webpack --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.

SanderSpies commented 9 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 :(.

BerkeleyTrue commented 9 years ago

This may be fixed in latest (0.13) since switching to the babel loader.