EDIT: Meteor 1.3 release is out and a npm package is about to be released allowing a direct use of CSS modules without Webpack
I would like to use https://github.com/gajus/react-css-modules in Meteor 1.3 via NPM. But the readme says to use Webpack. I never used Webpack as it seems to me to do the same build job as Meteor.
So do you know a way, in this specific case, for using React Module CSS in Meteor 1.3 beta?
Meteor v1.3.2 introduced built-in import functionality for
.css
files (as well as other CSS preprocessor files, such asless
andsass
) from within.js
and.jsx
.For example, given the following (simplified) folder structure,
where
some-module
is an npm module installed using:importing local and module stylesheets in
imports/client/main.jsx
:There is actually package for this. MDG is also considering bring webpacks on meteor core at some stage. And yes it is build tool. Just more modular and faster than current one. Its also pretty complex as build tools go, at least in my opinion.
To have webpacks in meteor just >
You need to remove ecmascripts as you get them from webpack as well and having 2 installs can cause errors.
For much more complete answer check Sam Corcos blog post and also Ben Strahan's comment for Meteor 1.3 Beta. I used it as tutorial to get different webpack package up.
https://medium.com/@SamCorcos/meteor-webpack-from-the-ground-up-f123288c7b75#.phcq5lvm8
For package you mentioned I think
webpack.packages.json
should look something like thisAnd webpack.config.js you could copy directly from
https://github.com/gajus/react-css-modules-examples/blob/master/webpack.config.js
You can start from scratch like this.
Start from scratch
Entry files
Your entry files are defined within your package.json. The main is your server entry and the browser is your client entry.
For more info please check this link