react-scripts build ignores css files when bundling

Viewed 363

I'm trying to build a project using create-react-app.

My project use a package that contains it's own css.

I've created my own custom css file to overwrite the package css and imported it in the index.js file. import './custom.css';

Locally and before running npm run build it works as expected. custom.css override the package css file when needed. But after running the command and with the css bundled into one file it doesn't work anymore ( since locally it's overriding the css because import './custom.css'; is ran after the package css file )

Does anyone know how to make it work ?

The only way i can think off include directly importing the css file in the generated index.html after the bundled css file but that seem very very error prone.

0 Answers
Related