birdofpreyru / babel-plugin-react-css-modules

Transforms styleName to className using compile time CSS module resolution.
https://dr.pogodin.studio/docs/babel-plugin-react-css-modules
Other
30 stars 12 forks source link

Support of named CSS imports (`css-loader`'s `namedExport`) #44

Closed birdofpreyru closed 4 months ago

birdofpreyru commented 6 months ago

css-loader's namedExport option (which is default in some cases since its v7.0.0) requires to import CSS stylesheets (when the mapping is needed in JS code) like this

import * as S from "./style.css";

// or, I guess
import { a, b, c } from "./style.css";

// Instead of just
import S from "./style.css";

Thus, we need to update this Babel plugin to support named CSS imports (which it currently does not).