Every time I use workers in a TypeScript project, I feel like I'm fighting it. I think this is the best way to do it.

To build:

npm i
npm run build