Multiple main in bundle relative path for preview
Hello, I tried using the beta feature bundle relative paths for preview. I looked at the code that was bundled in the preview, and if multiple functions/variables have the same name, it changes them to function1, function2, etc. The same applies to the main functions. But I think the main function of the script we want to execute might become main1/main2, and therefore the parameters are no longer correct.
The main() function should always be the main function of the current script ?
5 Replies
I have this "bug" when i import other scripts contains main() function
we're talking about the vscode preview right ?
yes
Ok if you have a minimal reproduction that would be helpful
if you can just share 2 scripts at precise path that would be sufficient
we are using esbuild under the hood
I wasn't able to reproduce with a minimal example
Sorry for the response time @rubenf , i have try with a minimal example:
i can reproduce the bug in this case:
script1.ts:
script2.ts:
i want to execute script1.ts, if i execute it with any data the
console.log(data)
result will be undefined, but if i comment this line: import { main as script2 } from './script2.ts'
the console.log(data)
will work correctly