-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
css-loader produces invalid es5 code #1033
Comments
Broken in 23bc1e9. |
Can you create reproducible test repo? |
Looks like bug, agree |
I'll try. It isn't so easy to extract repro from huge project :) |
Reproduced, WIP |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
No JS code produced.
Actual Behavior
css-loader produces
what is incorrect es5 code (also I don't think that having exported
undefined
key withundefined
value is good here).Code
I'll fill code later if it's really needed, but just looking into the code you're able to see difference between 3.3 and 3.4 versions.
Just look at https://github.com/webpack-contrib/css-loader/blob/v3.3.2/src/utils.js#L387-L389 and https://github.com/webpack-contrib/css-loader/blob/v3.4.0/src/utils.js#L417-L479. Previously (in 3.3.2) if exports length is 0 then it returns empty string. Now it doesn't check it and after
if (exports.length > 0) {
variableexportLocalsCode
isundefined
so that's why it produces incorrect output.How Do We Reproduce?
I don't have working example right now, but it looks like that it fails if css module exports nothing (e.g.
:global
expression only).The text was updated successfully, but these errors were encountered: