We’re splitting out our core react components into discrete, private npm modules. Each one of these modules uses webpack to produce a bundle.js and bundle.css. The package.json file looks like:
{
"name": "core-ui",
"main": "dist/bundle.js",
"style": "dist/bundle.css"
...
}
We are able to import the JS into our meteor project just fine (awesome!), but are still trying to figure out how to bring the styles into the meteor build pipeline. For now, we’ve created symlinks in the meteor projects that point to the local npm package’s bundle.css file. Meteor picks up that symlink like any other css file, and includes it in the compiled build.
Granted, I don’t believe the “style” property is official, but many modules in npm are starting to expose their css entry files in their package.json files using this style property. Has there been any discussion about how meteor might support this?