Why do TSyringe and reflect-metadata need to be installed as dependencies and not dev dependencies?

618 views Asked by At

I recently installed TSyringe into a Node project using TypeScript. TSyringe also needs reflect-metadata.

I initially installed these packages as dev dependencies and things worked fine in my dev env/TS land. But when I ran a production build I got errors about Node not being able to find those packages.

TypeScript is installed as a dev dependency in the project. Makes sense to me because the TS will get transpiled away. I'm wondering why TSyringe woudln't work the same way. Isn't all of the DI stuff happening at the TS level and it'd get compiled down to JS?

0

There are 0 answers