extender
extender copied to clipboard
Resulting code is not from Babel
The resulting Babel code is somehow transformed after the plugin ran.
I have been trying to figure out the problem but haven't found the solution yet. The relevant test ternary statement is
const a = false ? false ? 1 : 2 : 3
. Afteresbuild-plugin-babel
'sonLoad
is called and the content is transformed, I log the results in theonLoad
callback and getvar a = false ? (false ? 1 : 2) : 3;
for that line—which is good. I also double checked withbabel.transform
to make sure the extendscript preset works well.But when I check the final esbuild output file, the brackets disappeared. I am somewhat aware that the plugins for esbuild aren't the last line of bundling process, so it probably modified the babel output and removed the brackets. I am not too familiar with what goes on in esbuild between calling the plugins and writing to output, but it would be helpful if you might know the answer.
See https://github.com/fusepilot/babel-preset-extendscript/issues/15
Possible solution: https://github.com/evanw/esbuild/issues/1010#issuecomment-803865232