fgnass / node-dev

Zero-conf Node.js reloading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to run with custom typescript config file?

MaxmaxmaximusAWS opened this issue · comments

node-dev --project tsconfig-server.json src/server.ts

I have error:

node-dev --project tsconfig-server.json server/index.ts
C:\Program Files\nodejs\node.exe: bad option: --project=tsconfig-server.json
error Command failed with exit code 9.

How to pass --project tsconfig-server.json argument to ts-node module?

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

Could you tell me hou to do it via npm run please? Thanks a lot!

Try TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts. ts-node allows you to pass arguments via environment variables where needed. See https://github.com/TypeStrong/ts-node#tsconfig

Could you tell me hou to do it via npm run please? Thanks a lot!

It has been solved.

We should use TS_NODE_PROJECT=tsconfig-server.json node-dev src/server.ts in order to run in any env