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

comments option preserved all jsdoc style comments #82

Closed
jdalton opened this issue Dec 30, 2012 · 2 comments
Closed

comments option preserved all jsdoc style comments #82

jdalton opened this issue Dec 30, 2012 · 2 comments

Comments

@jdalton
Copy link

jdalton commented Dec 30, 2012

The comments options is preserving all jsdoc style comments, even when they don't contain @license or @preserve.

uglifyJS.OutputStream({
   'comments': true
});
@mishoo
Copy link
Owner

mishoo commented Jan 2, 2013

Indeed, this is by design actually.. Passing comments: true will retain all comments. The filtering for JSDoc-style comments is done in the CLI tool, see https://github.com/mishoo/UglifyJS2/blob/master/bin/uglifyjs#L130

So to keep only comments that contain @preserve or @license you'd pass a regexp:

comments: /@license|@preserve/

@mishoo mishoo closed this as completed Jan 2, 2013
@jdalton
Copy link
Author

jdalton commented Jan 3, 2013

The docs made me think that "comments": "all" would preserve all comments and so setting it to true would auto preserve comments with @license or @preserve.

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