css-modules-typescript-loader
css-modules-typescript-loader copied to clipboard
Doesn't export fields with css-loader ^4.0.0
We are using css-modules-typescript-loader to generate our types with CSS modules, css-loader and sass.
I'm seeing an issue in the generated typescript files from css-modules-typescript-loader. When we update to css-loader version 4, the exports have no fields in CssExports.
This works fine with css-loader version 3.6.0 but issue appears when updating to css-loader version 4.
It's maybe due to new export feature in css-loader - es6 export (esModule: true)
Hey @mattcompiles, do you think you could help us with this? :)
Same issue here, played around with the options of the css-loader, but did not get any export
Same here. I tried all different css-loader options and set esModule: false but type files are always generated empty. When I set mode to 'verify' it says the content has changed compared to the saved version and the diff shows it would remove all css entries from the new type file.
FYI: I ended up switching to
@teamsupercell/typings-for-css-modules-loader
as this repo seems no longer maintained. Worked with that loader.
For css-loader version 4 has different local export name from version 3. In the index.js file line 83, we can add function to make it work for both versions. See the pull request below for the fix.
Thanks @mydatahack for this PR! You rock! 🤘💀🤘