A lot of articles exist out there explaining how to hook up nodemon
or ts-node-dev
to automatically restart your TypeScript server on file changes, but restarting the whole server is starting to get pretty slow on my large TypeScript project, where startup times can take many tens of seconds (thanks typeorm
).
Frontend development has been dominated by boilerplates like create-react-app
, nextjs
and more that offer hot reloading without even a page refresh, resulting in very fast feedback times for frontend changes.
What's the equivalent for doing that on a Node API, especially one where the source files are in TypeScript, not JS? Should I be using tsc --watch
and then invalidating require.cache
as compiled output completes or something?
We use