Closed rkirov closed 5 years ago
On a second thought, a better fix would be to simply not add exports.Foo
to the alias map, because closure should resolve those locally. Will try that tomorrow.
Rewrote this to a much simpler fix. Instead of emitting a self-import, just skip the syntactic alias rewriting step. Turns out the JS compiler output is adequate we were just clobber it previously. PTAL.
It appears that the emit was previously very broken for this case (syntactically incorrect). This change fixes the emit by detecting rewrites that mention
exports.Foo
and rewrite them to the corresponding clutz emitted namespace.Note, that the test .d.ts is still partially incorrect, because we create a type/let pair for just for a let binding. With #896 this will be fully correct.