nest-cli icon indicating copy to clipboard operation
nest-cli copied to clipboard

[FEATURE] - use ts-node instead build & start

Open gimox opened this issue 9 years ago • 9 comments

what about use ts-node instead npm run build && npm run start on "serve" script? It's more efficient and speedy.

gimox avatar Nov 23 '17 13:11 gimox

this is my serve script:

"serve": "nodemon --exec ts-node -- ./src/server.ts",

gimox avatar Nov 24 '17 08:11 gimox

you should also check the ts-node-dev for live reload feature, it works grate for me, it's insanely fast, compiles only changed files, and uses unchanged from cache, just like webpack do

my serve script example: "serve": "ts-node-dev --fast --respawn ./src/server.ts"

myflowpl avatar Dec 05 '17 14:12 myflowpl

nodemon use ts-node . This is a standard, well tested and full working solution. ts-node-dev is something new.. it's not related to ts-node.

gimox avatar Dec 08 '17 15:12 gimox

ok, i'll try nodemon with ts-node to see how it compares to ts-node-dev

ts-node-dev is also using ts-node inside, just adds the watch functionality, so far works good, so may be someone else, also wants to try it out.

myflowpl avatar Dec 08 '17 16:12 myflowpl

I try it and my project crash with ts-node-dev. Work fine with ts-node and nodemon and tsc. It ‘s not good

gimox avatar Dec 09 '17 09:12 gimox

Hey guys ! serve command already use nodemon and ts-node. I think we can close the issue

thomrick avatar Dec 09 '17 12:12 thomrick

@ThomRick this command is not for the cli but for the app generated

gimox avatar Dec 11 '17 09:12 gimox

upgrade to 4.0.0 or 5.0.0 depends on the Nestjs major version you want to use. Use the typescript-starter repo with ts-node build and serve will next features

thomrick avatar Apr 17 '18 20:04 thomrick

Please which is recommended?

olawalejuwonm avatar Jul 20 '23 18:07 olawalejuwonm