Closed karadnized closed 1 year ago
Hi, merely importing the package only assigns certain functions to the global namespace Reflect
, and Closure Compiler sees no code that uses the newly defined functions, so it isn't a surprise that the output is empty.
Also, having an external module's global alias that is already declared somewhere in closure compiler's externs (like your choice of Reflect
) causes externs generated by TSCC to collide with closure compiler's own. I'd say it's safe-ish, but the behavior on externs collision isn't documented anywhere.
I think you don't need to declare it in external
key. If you have a reproduction steps with codes that make an essential use of the reflect-metadata
package, I can take a look.
And what's the issue with that repo? Tscc compiles the output just fine, and the output has the same behavior as the source.
@theseanl The library should add functions the Reflect global. Reflect.defineMetadata is not a native function. It will be added the library and that's what i don't see.
It's more like adding extra functions to Reflect by they aren't there :). If webpack example will help i can create one
Well, a good virtue of every bug report is to provide an expected behavior and an actual behavior you are observing. It seems that you don't understand what external
does.
I've been trying to use reflect-metadata but i'm unable to get compiled with ADVANCED compilation
tscc.spec.json
main.ts
import "reflect-metadata";
I see externs generated for the package but no source code generated.