-
-
Notifications
You must be signed in to change notification settings - Fork 48
Disable ts-node typechecking #51
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
Conversation
When, eg, `gulp` uses `interpret` to load a `Gulpfile.ts`, `ts-node` will search the containing directory for _all_ `.ts` files to run a typechecking pass on all of them (as of version `6`) - this is hugely unnecessary, and adversely impacts `gulp` startup time when using a `.ts` file. By simply disabling the typecheck pass (and only using the fast-transpile behavior), startup returns to pre-`6` performance. cc @blakeembrey for opinons, ref microsoft/TypeScript#23479
SGTM. This has been a problem for |
Is there no way to keep the typechecking on but still avoid processing all files? I'm nervous to bring this in as a non-breaking change as someone might be relying on the type checking. And then I wouldn't really want to bump gulp-cli a major just for this. |
@weswigham Is there a way to use the TypeScript compiler without type checking everything? I used to filter by |
@blakeembrey imho, in most cases, just using the first require'd ts file as the only root file for the compilation usually works OK - then files you don't actually use don't get checked and built. |
@weswigham That didn't work unfortunately, because some people expect it to work like |
@blakeembrey that can be worked around with explicit triple-slash-refs in your entry point, so it's not an insurmountable issue (I'd take questions of how to specify command line arguments more seriously, because I see no direct in-source solution for that - maybe custom in-source pragmas?). And for this usecase specifically, working like tsc is usually undesirable - in smaller projects I'd sometimes have a tsconfig for my source in the same directory as my gulpfile, but that config most definitely would not apply to a gulpfile.ts in that folder (as the build orchestrator is not part of the build it orchestrates!). And if you wanna claim it maps to a |
@weswigham Not applying the |
@weswigham New major released that skips |
@blakeembrey you rock!! I'll leave this open for a few days incase anyone stumbles over here. I was planning to do a once over on everything here next week. |
@blakeembrey I've read through the fallout to this change and I just wanted to say thank you for handling everything you've had to deal with. I'm going to close this issue because it seems like the people running into problems (because they don't understand semver) are opening issues on ts-node and not here. And those issues show them how to set the environment variable for the old behavior. |
When, eg,
gulp
usesinterpret
to load aGulpfile.ts
,ts-node
will search the containing directory for all.ts
files to run a typechecking pass on all of them (as of version6
) (instead of a module compilation with a root of the required file) - this is hugely unnecessary, and adversely impactsgulp
startup time when using a.ts
file (to the point where, in TS internally, we crashnode
because we have hundreds of MB of.ts
in our test subrepos). By simply disabling the typecheck pass (and only using the fast-transpile behavior), startup returns to pre-ts-node
-6
performance.cc @blakeembrey for opinons, ref microsoft/TypeScript#23479