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

Handling exported functions #984

Closed
yungvldai opened this issue Oct 23, 2022 · 3 comments
Closed

Handling exported functions #984

yungvldai opened this issue Oct 23, 2022 · 3 comments

Comments

@yungvldai
Copy link
Contributor

Hi! First of all thank you for your work!

Modification Proposal

I came across an interesting case in which a custom (modified) css-loader exports functions (as named exports).
The current implementation uses JSON.stringify, which causes export values of type function ​​to become undefined. It seems that we can fix this behavior quite easily without breaking anything by adding a check for typeof === 'function' and calling (locals)[key].toString() instead of JSON.stringify((locals)[key]).

What do you think?

Expected Behavior / Situation

Function code is inserted instead of undefined

Actual Behavior / Situation

Function code turns into undefined

Please paste the results of npx webpack-cli info here, and mention other relevant information

@alexander-akait
Copy link
Member

PR welcome 👍

@yungvldai
Copy link
Contributor Author

Thank you for answer! PR #985

@alexander-akait
Copy link
Member

Fixed

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

2 participants