-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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?
__toBinary getting renamed:
https://esbuild.github.io/try/#YgAwLjI1LjkALS1sb2FkZXI6LmJpbj1iaW5hcnkgLS1idW5kbGUgLS1mb3JtYXQ9ZXNtAGUAZW50cnkuanMAaW1wb3J0IHggZnJvbSAiLi9mb28uYmluIjsKY29uc29sZS5sb2coX190b0JpbmFyeSgiYWFhYSIpKTsKY29uc29sZS5sb2coeCk7AABmb28uYmluAGFhYWE