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

Fix to avoid minification problem with esbuild #1368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

diegovdev
Copy link

@diegovdev diegovdev commented Sep 20, 2024

esbuild will minify this to 1.toString (removing the trailing zero) which will result in a syntax error in the browser. A trailing zero will be removed during minification but a trailing 1 wont.

See image below:

SCR-20240920-kuxj

esbuild will minify this to 1.toString (removing the zero) which will result in a syntax error in the browser.
@diegovdev
Copy link
Author

Proof that it's the same resulting toString method, in the browser console:

image

@0f-0b
Copy link

0f-0b commented Sep 20, 2024

esbuild actually minifies 1.0.toString to 1 .toString (note the space), so it must be some other tool that misprinted the code. The bug is in that tool, not core-js.

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

Successfully merging this pull request may close these issues.

2 participants