Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Require the css file of a package using webpack

Recently I found myself want­ing to use the react-select pack­age and real­ized that I need to include the css that was present in its dist folder.

My appli­ca­tion is setup to use web­pack along with web­pack the mod­ule load­ers — css-loader and style-loader.

In order to directly use a file located at
node_modules/react-select/dist/react-select.css, I added the fol­low­ing line to my own application’s app.css file

app.css

@import url('~react-select/dist/react-select.css');

...
... All my other css
...

Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...