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
a prettified version of the pastebin shows that terser is inlining "pushHistory" which effectively causes the entire file size to double. Playing around with router.js, if you remove the inner function, and just do a try/catch, it stops it from trying to inline it which suggests it was not intended
the fix for me is to add module: true to the options
The text was updated successfully, but these errors were encountered:
This is happening because inline and unused are sometimes out of sync. It seems that inline knows that this const variable will not assign to the global object like a var would, but unused doesn't.
The workaround is to enable the toplevel: true which makes Terser able to remove variables on the top level of the script (IE assume that var a = 1 doesn't create window.a)
Bug report or Feature request?
sub optimal output
Version (complete output of
terser -V
or specific git commit)terser 5.19.4
Complete CLI command or
minify()
options usedterser
inputhttps://github.com/mbkv/mbkv.io/blob/4cc82a16037f418071d4df4072b064a53b54be89/markdown/router.js
terser
output or errorhttps://pastebin.com/tCr6NkBT
Expected result
a prettified version of the pastebin shows that terser is inlining "pushHistory" which effectively causes the entire file size to double. Playing around with router.js, if you remove the inner function, and just do a try/catch, it stops it from trying to inline it which suggests it was not intended
the fix for me is to add module: true to the options
The text was updated successfully, but these errors were encountered: