-
Notifications
You must be signed in to change notification settings - Fork 71
Build css modules using webpack in prod build #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi @sag1v - Sorry, yes, I agree this is just a starting point, not a finished example. I'm going to work on a full working solution, but it will be a few days before I complete it. Thanks for your patience! :) |
|
@coryhouse Thank you so much for doing this! |
Seems legit. Are we good to go? 🙏 😄 |
| "predeploy:docs": "npm run build:docs", | ||
| "deploy:docs": "gh-pages -d build", | ||
| "build:commonjs": "cross-env NODE_ENV=production babel ./src/components --out-dir ./lib --ignore spec.js", | ||
| "build:commonjs": "cross-env NODE_ENV=production webpack --config config/webpack.config.prod.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure webpack can keep the folder structure of the components for both the js and css files?
|
Hi Sagiv - Sorry, I'm busy traveling out of the country for consulting and committed this as work in progress just to back it up. It's not complete. Not sure when I'll get it done since consulting work is very busy right now, but I think this commit is in the right direction. |

This is a quick example of using webpack to compile CSS Modules for production. Not perfect, since this also processes the JS, which we're already handling separately via the
build:commonjsscript, but you can throw the JS processed by Webpack away.