birdofpreyru/react-utils

Switch to named CSS imports (css-loader `namedExport` for ES module builds)

Closed this issue · 1 comments

Here, and also similarly in the Webpack config for libraries:

// TODO: This flag defaults `true` for ES module builds since
// css-loader@7.0.0:
// https://github.com/webpack-contrib/css-loader/releases/tag/v7.0.0
// For now we'll keep it `false` to avoid a breaking change for
// host projects, and also because babel-plugin-react-css-modules
// we rely upon is pending an upgrade to support named style
// imports:
// https://github.com/birdofpreyru/babel-plugin-react-css-modules/issues/44
namedExport: false,

It will be a breaking change, and it is also blocked by birdofpreyru/babel-plugin-react-css-modules#44.

Well... not sure the benefits of adopting named exports of CSS, but the drawback of the need to update or dependent code, with easy to miss changes leading to bugs is obvious. Thus, probably not needed.