ts-node & nodemon takes 2 minutes to start; too slow
See original GitHub issueTL;DR Question
What I should do, to start my server in less than 1 minute?
Long-version Question
I have a Node.js server with Express (and TypeORM) that I want to run, but when I compile TypeScript it takes my every time 2 minutes to start, and it really gets annoying and moves you back in progress. I also use Nodemon to restart my server, but as you guess if it takes 2 minutes to run the server every time, Nodemon is really worthless for my case. I have searched on the internet but nothing seems to work out for me. Is there something else that I can use, or change my configuration somehow to compile faster?
Desired Behaviour To have my Node.js server start at maximum 1 minute.
Alternatives I have considered
I have changed my config options in the tsconfig.json file, but nothing seems to fix the issue.
Additional context
I have been using the --transpile-only flag, and it still does not compile if 2 minutes have not passed.
Thanks for taking time to answer to my question and help me. I appreciate it a lot
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17
Top Related StackOverflow Question
I finally used
tsc -wwithnodemon&concurrently, and everything seems to work as expected, but again Node.js takes also some time to start the server. However, the compilation is really fast, astsc -wuses incremental compilation, and does not recompile everything from the start asts-nodedoes.Closing as no response was given by someone
I stumbled upon this exact same problem, and my only solution was to install and use ts-node-dev (essentially replacing nodemon). It is way faster and apparently very much optimized for ts. You might wanna give it a go if you haven’t already 😄