ts-node icon indicating copy to clipboard operation
ts-node copied to clipboard

remove `cwd` option, or at least stop resolving entrypoint relative to it

Open cspotcode opened this issue 3 years ago • 0 comments

Today, cwd affects resolution of the entrypoint so when you ts-node --cwd foo bar.ts then you run foo/bar.ts

Seems nice enough from a user perspective, but from a maintenance and compatibility perspective it gets hairy. Cuz what should happen when user code forks a child process in a different working directory, expecting the entrypoint for that child process to be resolved relative to that working directory.

https://github.com/TypeStrong/ts-node/pull/1814#discussion_r917322122

It's not clear we should even have a --cwd option. tsc and node do not. At the very least, it shouldn't be affecting the resolution of entrypoint scripts. That makes us incompatible with node and it's feature creep.

cspotcode avatar Jul 12 '22 18:07 cspotcode