Closed sirenkovladd closed 11 months ago
Could you please simplify example, too deep nesting and not looks like code you keep in your repository.
You can also apply needed modifications to https://github.com/coderaiser/putout/blob/v34.8.1/packages/plugin-minify/lib/merge-variables/index.js.
If you keep state in variable on move it here in there you should do one of next:
🐊Putout cannot support all cases that is possible to write, only real human readable code.
Feel free to reopen if you have something to add.
Unfortunately, this is the code I got from esbuild, so I can't change it
in fact, the original code works on the DOM, so as a result it is quite complex (I tried to simplify it so that it could be called without using other packages)
the main problem is that the order initialization of the variable s
has changed its position in the function s(n)
Maybe you can provide original code? Or simplify it?
result
You can see the difference between the original code and the minification (result 2 and 4) The problem is plugin-minify -> merge-variables
in function s() variable s init before calling v(o) should be the opposite