I recently found myself wanting to run a shell script each time my Webpack build ran, whether or not I was in watch mode.

I was developing two TypeScript packages in a monorepo, with one serving as a dependency of the other. Since the packages were being built in tandem, I wanted to emit TypeScript definitions while actively developing Package A, otherwise type hinting would get confused inside of Package B if I made changes to Package A and didn’t run a full rebuild.

The easiest way to emit definitions from a Typescript library is to use tsc --emitDeclarationOnly from…

Drew Loomer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store