Skip to content
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

Configuring Webpack loaders for CSSModules + Preprocessor #32

Closed
sthzg opened this issue Jun 24, 2016 · 1 comment
Closed

Configuring Webpack loaders for CSSModules + Preprocessor #32

sthzg opened this issue Jun 24, 2016 · 1 comment

Comments

@sthzg
Copy link
Member

sthzg commented Jun 24, 2016

Moved from react-webpack-generators/generator-react-webpack#248

After installing the 4.x generator with CSSModules + Preprocessor (e.g. LESS) and creating a new component the component template creates

- Foobar.js
- foobar.cssmodule.less
import styles from './foobar.cssmodule.less';
// ...
<div className="foobar-component" styleName="foobar-component" />

Rendering will fail with an exception of css module is undefined, because the loaders in cfg/base are configured for for the *.less files only and miss a test against *.cssmodule.less and a loader that is adapted for cssmodules ('css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]').

@weblogixx
Copy link
Member

Just added your pr, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants