react-toolbox / react-toolbox-themr

A tool to statically extract and generate custom themes for React Toolbox
MIT License
240 stars 24 forks source link

Webpack 4 and mini-css-extract-plugin issue with toolbox css import #68

Open AndreasSchouten opened 5 years ago

AndreasSchouten commented 5 years ago

I'm upgrading my project to webpack 4 and use the new recommended mini-css-extract-plugin.

When importing a toolbox class i.E.

import Switch from 'react-toolbox/lib/switch'; (or import {Switch} from 'react-toolbox/lib/switch';)

I get this error:


ERROR in ../node_modules/react-toolbox/lib/button/theme.css
Module build failed (from ../node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ../node_modules/css-loader/index.js):
Error: composition is only allowed when selector is single :local class name not in ".raised", ".raised" is weird

Also this error is thrown if I use an import in an css file like: @import "react-toolbox/lib/button/theme.css";