Open mrmeku opened 2 years ago
I bumped into this problem frequently while developing the worker mode for ts_project. tsc will prefer .ts
over other extensions, unfortunately.
Doing this will come at a cost, however, as we'd have to recursively search the dependency graph.
I think https://github.com/microsoft/TypeScript/issues/22208 is the actual issue here, there's no way for us to properly invoke tsc
. It's labelled committed
so maybe we could fix it?
We will put this on the prioritized
list, but it is blocked by the fix for microsoft/TypeScript#22208.
Sometimes a
ts_project
might depend on a target which has both.ts
source files and.d.ts
compiled outputs in it (there are a variety of use cases for this but the most common is that you want to have your javascript bundler be able to run without invoking the typescript type checker. The bundler will depend on the .ts source files only and not the compiled .d.ts files).For example:
In these cases, the
.d.ts
files should be included in the sandbox and the.ts
files should be excluded from the sandbox. Including the.ts
sources breaks the semantics or typescript projects since all source files need to be contained under the root directory of the typescript compilation..ts
files from transitive deps will not be under the correct root directory. Furthermore, we do not want to re-compile these sources since they've already been compiled.