-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-node's require hook is replicating the TS compiler too much #157
Comments
I'm not sure why it'd cause any issues, and I agree it's replicating too much of the compiler - you can read existing discussions on that point. The problem is, the hooks provided by the compiler for loading tsconfig is not enough and buggy - for instance, can't resolve on Windows. |
If you want to let me know why the change would have made any impact, definitely let me know - I'm not sure how fixing the functionality could have caused this, as far as I know both the typescript method and mine is just resolving and parsing a JSON file. |
Sorry, on mobile but I think I see what it'd be. The fallback for no tsconfig file is an empty object - I'll make a change in the tsconfig project to return the old style object - empty files array and compiler options. |
@weswigham FWIW, no functionality has fundamentally changed here so I'm still unsure about the core premise of the issue. I've updated a patch on Edit: TypeStrong/tsconfig@cbdaae6. |
@weswigham How should an empty |
@blakeembrey The only semantic change which was important here was the presence or absence of a |
With
1.2
,ts-node
swapped to usingtsconfig
to "simplify loading the tsconfig". The new dependency used to load atsconfig
file goes too far in trying to replicatetsc
's default settings for compilation. At version1.1
when using therequire
hook when there was notsconfig
present,ts-node
only compiled therequired
file and anything it included. With version1.2
, it attempts to traverse the entire directory the required file is in and all subdirectories.See this issue over at TypeScript for the problems this change caused.
I'd ask that you reconsider the change in behavior; while this behavior is OK for the TS compiler itself, it seems inappropriate for a
require
hook (which was invoked on a specific entrypoint).The text was updated successfully, but these errors were encountered: