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

Allow specific debugger statements to be preserved #3252

Open
JoolsCaesar opened this issue Sep 7, 2018 · 0 comments
Open

Allow specific debugger statements to be preserved #3252

JoolsCaesar opened this issue Sep 7, 2018 · 0 comments

Comments

@JoolsCaesar
Copy link

Bug report or feature request?
Feature request

I have source code with several debugger; statements scattered around. When I minify this code, I want to remove all but one of them, similar to how you can preserve comments with @preserve. The drop_debugger option allows you to change this, but only with an all or nothing effect. I don't have a preference on the notation, but I've used @preserve-debugger just to illustrate the issue.

Uglify version (uglifyjs -V)
uglify-es 3.3.10
JavaScript input

debugger;
debugger; // @preserve-debugger: I want this one to stay
debugger;

The uglifyjs CLI command executed or minify() options used.
uglifyjs input -c drop_debugger=false -o output1
uglifyjs input -c -o output2
JavaScript output or error produced.
output1:

output2:

debugger;debugger;debugger;
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

1 participant