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
WebComponents connectedCallback gets mangled/minified #1170
Comments
I "fixed" the issue by putting the function-name inside quotes --> like so:
This way the function-name is not touched and my problem goes away. Still --> I think "connectedCallback" should be added to list of reserved (not to be mangled) function-names. If you don't agree you may just close this ticket. |
Hello! Thanks for reporting. The properties in this list aren't mangled by default: https://github.com/terser/terser/blob/master/tools/domprops.js And apparently connectedCallback isn't there indeed. A quick google of the webcomponents API revealed |
I just lost hours due to this issue ;-; would be nice to have this properly fixed to not have others run into the same problem! |
Bug report or Feature request?
Bug report?
Version (complete output of
terser -V
or specific git commit)v5.12.1
Complete CLI command or
minify()
options usedterser
inputterser
output or errorExpected result
connectedCallback is a reserved function name when using WebComponents yet terser seems not to care.
I tried using "reservedNames" but that seems to only work with variables and not with functions
I tried using "keep_fnames:/connectedCallback/" @ three locations (top-level, inside mangle, inside compress) --> no effect
I suppose I could fix my problem by abusing the "nameCache" but that is something I would like to avoid.
Thank you!
The text was updated successfully, but these errors were encountered: