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
Hmm, this one's tricky. Matching the TypeScript compiler's code generation for this exactly seems to potentially depend on actually evaluating types, which esbuild's approach to TypeScript compilation doesn't permit (esbuild treats type annotations as whitespace). For example, you can technically do this and the TypeScript compiler won't remove the export:
declareletFoo: any;export{Foo};
I'm not sure if this case is important or not, since doing this causes the TypeScript compiler to generate invalid code. I think it could potentially be sufficient for real-world code bases to just remove exports for things that aren't local symbols. That will certainly fix cases like this at least. I'm going to try that and see how it goes.
ESBuild removed the types but kept the export, which results in SyntaxError.
esbuild v0.3
The text was updated successfully, but these errors were encountered: