I have TypeScript
and ts-node
installed globally and have the following files/directories -
+tsproject
+src
-main.ts
-tsconfig.json
I can compile the main.ts
file with tsc src/main.ts
command or execute it directly with ts-node src/main.ts
command. However, I'd like to use the commands tsc main.ts
and ts-node main.ts
instead, while setting some configuration for the path src
so that the compiler knows where the main.ts
file is located.
I have tried setting "rootDir": "src/"
in the tsconfig.json
file, but it didn't work - basically both commands complain about main.ts
not being found.
My main purpose would be executing a specific file with ts-node
. Any suggestions?