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]').
Moved from https://github.com/newtriks/generator-react-webpack/issues/248
After installing the 4.x generator with CSSModules + Preprocessor (e.g. LESS) and creating a new component the component template creates
Rendering will fail with an exception of
css module is undefined
, because the loaders incfg/base
are configured for for the*.less
files only and miss atest
against*.cssmodule.less
and a loader that is adapted for cssmodules ('css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]'
).