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
I am implementing something where it would be useful to have a base64-to-uint8array decoder at runtime. Since I'm already loading a few assets with the 'binary' loader, esbuild includes its own fast base64 decoder. However when I try to access it using its name __toBinary esbuild renames it to __toBinary2 because it thinks my __toBinary is something else in the global scope and so it should not clobber that. I could just paste esbuild's implementation into my own files, but esbuild doesn't (can't) remove the second copy which just seems a little dumb. Is there any way to allow module code to reference the same functions that esbuild has when the same thing needs to be done? If not, can one be added?
I am implementing something where it would be useful to have a base64-to-uint8array decoder at runtime. Since I'm already loading a few assets with the 'binary' loader, esbuild includes its own fast base64 decoder. However when I try to access it using its name
__toBinaryesbuild renames it to__toBinary2because it thinks my__toBinaryis something else in the global scope and so it should not clobber that. I could just paste esbuild's implementation into my own files, but esbuild doesn't (can't) remove the second copy which just seems a little dumb. Is there any way to allow module code to reference the same functions that esbuild has when the same thing needs to be done? If not, can one be added?__toBinary getting renamed:
https://esbuild.github.io/try/#YgAwLjI1LjkALS1sb2FkZXI6LmJpbj1iaW5hcnkgLS1idW5kbGUgLS1mb3JtYXQ9ZXNtAGUAZW50cnkuanMAaW1wb3J0IHggZnJvbSAiLi9mb28uYmluIjsKY29uc29sZS5sb2coX190b0JpbmFyeSgiYWFhYSIpKTsKY29uc29sZS5sb2coeCk7AABmb28uYmluAGFhYWE
__toBinary included twice:
https://esbuild.github.io/try/#YgAwLjI1LjkALS1sb2FkZXI6LmJpbj1iaW5hcnkgLS1idW5kbGUgLS1mb3JtYXQ9ZXNtAGUAZW50cnkuanMAaW1wb3J0IHggZnJvbSAiLi9mb28uYmluIjsKaW1wb3J0IF9fdG9CaW5hcnkgZnJvbSAiLi90b0JpbmFyeS5qcyIKY29uc29sZS5sb2coX190b0JpbmFyeSgiYWFhYSIpKTsKY29uc29sZS5sb2coeCk7AABmb28uYmluAGFhYWEAAHRvQmluYXJ5LmpzAHZhciB0YWJsZSA9IG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