Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't export fields with css-loader ^4.0.0 #39

Open
bjephson opened this issue Jul 28, 2020 · 7 comments
Open

Doesn't export fields with css-loader ^4.0.0 #39

bjephson opened this issue Jul 28, 2020 · 7 comments

Comments

@bjephson
Copy link

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.

@budarin
Copy link

budarin commented Aug 24, 2020

It's maybe due to new export feature in css-loader - es6 export (esModule: true)

@astorije
Copy link

astorije commented Sep 3, 2020

Hey @mattcompiles, do you think you could help us with this? :)

@LeopoldLerch
Copy link

Same issue here, played around with the options of the css-loader, but did not get any export

@tuhlmann
Copy link

tuhlmann commented Sep 8, 2020

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.

@LeopoldLerch
Copy link

FYI: I ended up switching to

@teamsupercell/typings-for-css-modules-loader

as this repo seems no longer maintained. Worked with that loader.

@takahirohonda
Copy link
Contributor

takahirohonda commented Sep 21, 2020

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.

@matthewhartman
Copy link

Thanks @mydatahack for this PR! You rock! 🤘💀🤘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants