Which I believe is still the recommended way to do things?!
However, the package in question "react-select" has both JS and CSS as part of the package. The JS seems to load perfectly fine, but the CSS is seemingly nowhere to be seen. So how exactly does one go about including the CSS into the build? Iām currently using the Meteor Chef react base as a testing ground at the moment, and in the application.scss Iāve tried adding a path to the packageās CSS, eg. @import "../../packages/npm-container/.npm/package/node_modules/react-select/dist/default.css"; but that doesnāt seem to work.
Iāve seen something called npm-css which looks like it might help, but Iām not entirely sure, as itās not built with Meteor in-mindā¦
I dont know if there is a better solution, but Iām copying the css into my package and adding
api.addFiles(āstyles/react-select.cssā) to packege.js
Thanks for the answers guys, and donāt get me wrong, theyāll both work, but my god, I was hoping for a slightly more elegant / āofficialā way. Is there really nothing more robust?
So react-select declare a field āstyle: dist/default.cssā in package.json. This field seems to be used by certain utilities, like the parcerify plugin for browserify. Since meteor-react is using cosmos:browserify (for now) it may be possible to configure browserify to use parserify to bundle the css for you.
This is the kind of solution that I was more on about; itās just a shame that thereās no guide or official āwayā to do it. But thanks for the tips, Iāll take a look at partialify now.
EDIT: I looked for parcerify, but I think you meant partialify.