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

feature request: allow to mark debugger as pure #1809

Closed
ankurk91 opened this issue Nov 27, 2021 · 2 comments
Closed

feature request: allow to mark debugger as pure #1809

ankurk91 opened this issue Nov 27, 2021 · 2 comments

Comments

@ankurk91
Copy link

Hi,

I could not find a way to remove debugger from output JS during minification

I was able to remove console.log using pure option but not the debugger

Related Issue
#28

@evanw
Copy link
Owner

evanw commented Nov 27, 2021

The way to do this with esbuild is to use general-purpose code-removal mechanisms like this:

if (!window.REMOVE_DEBUGGER) debugger;

If you pass --define:window.REMOVE_DEBUGGER=true --minify to esbuild, this code will be removed.

@ankurk91
Copy link
Author

The debugger should be removed by default during minification.

Or allow us to mark it as pure

@ankurk91 ankurk91 changed the title remove debugger from minified js feature request: allow to mark debugger as pure Dec 7, 2021
@evanw evanw closed this as completed in ce7262f Dec 29, 2021
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