-
Notifications
You must be signed in to change notification settings - Fork 207
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
babel-plugin-minify-dead-code-elimination removes function names #188
Labels
Comments
Merged
1 task
I'm happy with your suggestion of enabling that option during tests 👍 |
mpeyper
added a commit
to mpeyper/kcd-scripts
that referenced
this issue
Jan 9, 2021
3 tasks
kentcdodds
pushed a commit
that referenced
this issue
Jan 10, 2021
* fix(babel): keep function names to improve stack traces in tests Fixes #188 * fix(babel): remove minify babel plugin if minify env variable is false
🎉 This issue has been resolved in version 7.5.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kcd-scripts
version: 7.5.3node
version: 12.20.0npm
(oryarn
) version: 6.14.8Relevant code or config
What you did:
Run
kcd-scripts build
What happened:
The output is
Reproduction repository:
Babel REPL
Problem description:
The name of the function returned in
createFunc1
gets removed thanks tobabel-plugin-minify-dead-code-elimination
. This is causing me problems in a node package (specifically a testing library) where the name gets removed and consequently does not appear in stack traces which hurts debugability when things go wrong.I can understand the desire to remove this when building for browsers (reduced bundle size), but I don't personally see many advantages to this for a node/test package.
Suggested solution:
There is an option to keep function names in the plugin, so we could set that the be true and keep the rest of the functionality. We could use the
isTest
flag to conditionally set the option for tests only.Similarly, we could use the
isTest
flag to remove the plugin all together for tests.Either solution would suffice for my issue. I'm also happy to submit the PR for this change if you agree with it and can advise me which approach is your preference.
The text was updated successfully, but these errors were encountered: