Open joeyparrish opened 1 year ago
This fails with TypeScript 4.9.4, but doesn't fail with the 3.6 or 3.7 versions that you test with in gulp-typescript.
It looks like you haven't updated typescript/dev in 3 years, but a regression test for this will not be effective without testing against TypeScript v4.
The minimum version I can find that fails in this case is v4.3.x.
Expected behavior: If I use
rootDirs
(plural) and notrootDir
(singular) in tsconfig.json, onlyrootDirs
should be passed to the compiler.Actual behavior: compiler.ts synthesizes a value for
rootDir
, which is then passed to the compiler. This overridesrootDirs
and causes my project to fail withgulp-typescript
, even though it builds withtsc
.Your gulpfile:
Include your gulpfile, or only the related task (with
ts.createProject
).tsconfig.json
Include your tsconfig, if related to this issue.
Code
Include your TypeScript code, if necessary. Not strictly necessary, given:
I have a simple fix in mind that works for me locally. In compiler.ts, rootDir is created on this.project.options, when it should instead be created on this. It should fall back through options.rootDir, options.rootDirs[0], and then finally the computed version that exists today. With this change made locally, everything works correctly. Either rootDir or rootDirs[0] can be used to determine the locations of things, but the config from tsconfig.json won't be modified inappropriately before being passed to the compiler.
I will send a PR shortly.