Open davethieben opened 9 months ago
Good find
Not got a lot of time to look at this but PRs welcome.
It should be relatively easy to trace this though, look where RemoveUnneededCode
ends up getting piped, it will be to one of the Visitors
after JsParser
has run. The code the checks if a particular AST node is needed or not is not paying attention to exports, or rather exports are not declaring their references in a way that the remover pays attention to
version: 1.20.7 (through LigerShark.WebOptimizer v3.0.396)
Describe the bug if RemoveUnneededCode = true, local functions are being pruned even they are referenced from an object literal export
To Reproduce invoking:
Minified output or stack trace
Excepted output code
which is what you get if you set
RemoveUnneededCode = false