Add build step to the TypeScript compiler for composite projects

483 views Asked by At

Is there a way I can hook into the command tsc --build in order to leverage an extra build-step in composite TypeScript projects?

I have a monorepo with many TypeScript projects. But each one needs an extra step when building, which converts Joi schemas to TypeScript definitions.

Obviously I'm able to simply run a script from npm, but the tsc --build command actually builds all projects that have been referenced in the tsconfig.json files, which means I can build everything with one command. But when it builds I need a way to hook into each build such that each project can also add this Joi -> TypeScript step, for every (or some) projects referenced.

Is there any way to do this?

0

There are 0 answers