SpicyyRiice
SpicyyRiice

Reputation: 156

How to override a css file inside node_modules

I need to modify a css file from dependency, located in "node_modules". But when I do "npm install", it will overwrite everything that I modified in the css files from the node module.

Is there something to prevent this overwrite and and keep the modification that I've made in the node modules

Upvotes: 0

Views: 2973

Answers (1)

Henrik
Henrik

Reputation: 382

I would not do this, patching files from node_modules is in general a very bad idea. Either fork their project and make a private npm package with the modified css file, or modify the file after install with postinstall. It's still not recommended since the class names can be modified in later builds or required styling can change making it not usable, so the first option is the best.

Upvotes: 1

Related Questions