Skip to content

Commit 874f197

Browse files
committed
Fix #302 - will now correctly add default tsconfig path if omitted.
1 parent 67f3765 commit 874f197

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

tasks/modules/tsconfig.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tasks/modules/tsconfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ function getTSConfigSettings(raw: ITargetOptions): ITSConfigSupport {
185185
tsconfig: tsconfigName
186186
};
187187
}
188+
if (!('tsconfig' in <ITSConfigSupport>raw.tsconfig) &&
189+
!(<ITSConfigSupport>raw.tsconfig).passThrough) {
190+
(<ITSConfigSupport>raw.tsconfig).tsconfig = 'tsconfig.json';
191+
}
188192
return raw.tsconfig;
189193
} catch (ex) {
190194
if (ex.code === 'ENOENT') {

test/optionsResolverTests.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/optionsResolverTests.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,22 @@ export var tests : nodeunit.ITestGroup = {
748748

749749
test.done();
750750
}).catch((err) => {test.ifError(err); test.done();});
751+
},
752+
"omitting tsconfig property of tsconfig object defaults to 'tsconfig.json'": (test: nodeunit.Test) => {
753+
test.expect(4);
754+
const cfg: any = {
755+
tsconfig: {
756+
overwriteFilesGlob: false
757+
}
758+
};
759+
const result = or.resolveAsync(null, cfg).then((result) => {
760+
test.strictEqual((<ITSConfigSupport>result.tsconfig).tsconfig, "tsconfig.json", "expected default to be set.");
761+
762+
test.ok(result.CompilationTasks.length > 0, "expected some compilation tasks from default tsconfig.json");
763+
test.strictEqual(result.errors.length, 0, "expected zero errors.");
764+
test.strictEqual(result.warnings.length, 0, "expected zero warnings.");
765+
test.done();
766+
}).catch((err) => {test.ifError(err); test.done();});
751767
}
752768
}
753769
};

0 commit comments

Comments
 (0)