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

Support esbuild --keep-names to prevent class/function names erasing #335

Closed
inca opened this issue May 25, 2022 · 2 comments
Closed

Support esbuild --keep-names to prevent class/function names erasing #335

inca opened this issue May 25, 2022 · 2 comments

Comments

@inca
Copy link

inca commented May 25, 2022

As stated in evanw/esbuild#931, evanw/esbuild#510 and elsewhere, sometimes it is undesirable to have class names erased.

Current behaviour of esm.sh seems to be erasing the class/function names, e.g. export class Price { ... } would be transpiled into var t = class {}; export { t as Price } which makes mahPrice.constructor.name return "t" instead of "Price".

Esbuild supports --keep-names which solves this problem; however, there is currently no way of enabling it with esm.sh.

@ije ije closed this as completed in caeafd7 May 28, 2022
@inca
Copy link
Author

inca commented May 30, 2022

Thank you! You folks are the best ❤️

@ije
Copy link
Member

ije commented May 30, 2022

thanks for suggestion

@inca inca changed the title Support esbuild --keep-names to prevent Ccass/function names erasing Support esbuild --keep-names to prevent class/function names erasing May 30, 2022
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