I had created a few Angular libraries for my organization as separate npm packages. A few of these components make use of classes decorated with decorators which add metadata using reflect-metadata.
It is now required to gain access, in a separate node project (not angular project/library) to the information stored in the metadata of these classes. I have no idea what the proper way of doing this is.
What I've tried: I've created a node project(with webpack & typescript) which installs one of the libraries. Inside the index.ts, I am simply calling
import * as Components from '@org/the-library'; console.log(Components.ComponentOne)
The webpack build works, but when I'm running the generated index.js, there's a lot of output showing up (looks like it's generating the whole compiled angular library, which has about 4mb) and at the end I'm getting the following error:
Error: The injectable 'MZ' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available. The injectable is part of a library that has been partially compiled. However, the Angular linker has not processed the library such that JIT compilation is used as a fallback.
I would appreciate some insights on how I can fix this issue or even suggestions for other approaches - the end result only needs to allow me to be able to use Reflect.getMetadataKeys() on a class.