What I should do, to start my server in less than 1 minute?
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.
I finally used tsc -w with nodemon & 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, as tsc -w uses incremental compilation, and does not recompile everything from the start as ts-node does.
Closing as no response was given by someone
thank you
Your welcome!
@georgekrax can you share your package.json script?
Yes, it is ts-node -r tsconfig-paths/register src/index.ts. However, now that I have started to use it again it is faster, and this issue might have been caused due to a "buggy" version that I had installed.
Most helpful comment
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