This is an example on how to make webpack-multiple-themes-compile work with create-react-app
.
I'd consider this really a hack as some things have to be changed in the default webpack configuration, so there are a few issues:
- When adding the new entry points for the themes (i.e. for
theme-custom.css
), the original entry points have to be re-shaped and as a result (at least in my build) the first run of the application results in a blank page, but after the reloading everything works as expected. - The number of themes that can be added is limited as the compiler runs out of memory very soon. I think this may be because of how CRA manages the entry points under the hood and we are messing with it with this hack.
Apart from these, I haven't found any issues neither in my dev nor production environments.