nestjs / nest-cli

CLI tool for Nest applications 🍹
https://nestjs.com
Other
1.97k stars 394 forks source link

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

Closed gimox closed 6 years ago

gimox commented 6 years ago

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

gimox commented 6 years ago

this is my serve script:

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

myflowpl commented 6 years ago

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"

gimox commented 6 years ago

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.

myflowpl commented 6 years ago

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.

gimox commented 6 years ago

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

thomrick commented 6 years ago

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

gimox commented 6 years ago

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

thomrick commented 6 years ago

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

olawalejuwonm commented 1 year ago

Please which is recommended?