I get the following error when running react-app-rewired build --library:
/src/components/Button/Button.css
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
The css is imported as: import "./Button.css".
Replacing
with
config.plugins = [
new ExtractTextPlugin("styles.css"),
];
seems to solve the problem..