fix(ngc): work with typescript@next

This is required due to breaking change in TS, see
https://github.com/Microsoft/TypeScript/pull/8841#issuecomment-227300348
This commit is contained in:
Alex Eagle
2016-06-23 14:26:54 -07:00
parent 42a5b6cbda
commit f463e09b9f
2 changed files with 9 additions and 2 deletions

View File

@ -54,9 +54,11 @@ export class Tsc implements CompilerInterface {
this.basePath = basePath;
// Allow a directory containing tsconfig.json as the project value
// Note, TS@next returns an empty array, while earlier versions throw
try {
this.readDirectory(project);
project = path.join(project, 'tsconfig.json');
if (this.readDirectory(project).length > 0) {
project = path.join(project, 'tsconfig.json');
}
} catch (e) {
// Was not a directory, continue on assuming it's a file
}