TeamSupercell / typings-for-css-modules-loader

Webpack loader that generates TypeScript typings for CSS modules from css-loader on the fly
MIT License
202 stars 30 forks source link

Does not work with css-loader 6 + esmodules + namedExport: true #65

Open AprilArcus opened 2 years ago

AprilArcus commented 2 years ago

When chained after css-loader 6.x with options.esModule: true (the default), and options.modules.namedExport: true (not the default), typings-for-css-modules-loader dies on this line, since it does not find exports.locals in the emitted source:

https://github.com/TeamSupercell/typings-for-css-modules-loader/blob/846a700efdbb697f0a561622a85befd9a049f961/src/index.js#L64-L66

nyngwang commented 6 months ago

@AprilArcus Are you still using this plugin? Just asking.

AprilArcus commented 6 months ago

Nope

nyngwang commented 6 months ago

@AprilArcus Then what's the alternative you're using?

AprilArcus commented 6 months ago

I'm no longer attached to the product team which used this plugin, so my advice is hypothetical.

Consider adopting https://www.npmjs.com/package/typed-scss-modules as a pre-build stage, or using it as the basis for a novel loader for webpack or your favorite modern bundler or meta-framework.