You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the legal comment is removed when this package is bundled (with browserify) and minified (with UglifyJS2).
Let me first say that this IS an issue in Uglify, see mishoo/UglifyJS#88 (comment) for more info. Uglify seems to fail adding the comment node to the AST. I post this issue more as FYI if you are concerned about userland honouring the legal stuff.
Testing this is pretty easy:
> browserify -r base-64 | uglifyjs --beautify --comments all
The real solution would ofc to fix Uglify but the referenced issue above is old and I don't expect to see any fix soon.
By doing some shotgun debugging I found that moving the introductory semicolon to be the first character in the file, before the legal comment, makes Uglify parse it and make it a part of the AST. Also removing the semicolon renders the same result but makes the code vulnerable to other bundling processes like concatenation.
Tested with browserify@13.0.0 and uglify@2.6.1 but saw issue with older versions aswell.
Thanks for developing this package!
The text was updated successfully, but these errors were encountered:
Hello,
I noticed that the legal comment is removed when this package is bundled (with browserify) and minified (with UglifyJS2).
Let me first say that this IS an issue in Uglify, see mishoo/UglifyJS#88 (comment) for more info. Uglify seems to fail adding the comment node to the AST. I post this issue more as FYI if you are concerned about userland honouring the legal stuff.
Testing this is pretty easy:
I also see this in https://github.com/mathiasbynens/utf8.js
The real solution would ofc to fix Uglify but the referenced issue above is old and I don't expect to see any fix soon.
By doing some shotgun debugging I found that moving the introductory semicolon to be the first character in the file, before the legal comment, makes Uglify parse it and make it a part of the AST. Also removing the semicolon renders the same result but makes the code vulnerable to other bundling processes like concatenation.
Tested with browserify@13.0.0 and uglify@2.6.1 but saw issue with older versions aswell.
Thanks for developing this package!
The text was updated successfully, but these errors were encountered: