From ff66eca9eb717e1dace86bf9e3813d5b0abef9c9 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Mon, 9 May 2016 08:42:31 -0700 Subject: [PATCH] fix: use options sourceDir, and fix null property access. Also use 1.9 proper tsconfig reading. Fixes #619. --- lib/broccoli/angular2-app.js | 4 +++- lib/broccoli/broccoli-typescript.js | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/broccoli/angular2-app.js b/lib/broccoli/angular2-app.js index e9a875497af3..6839fe9db789 100644 --- a/lib/broccoli/angular2-app.js +++ b/lib/broccoli/angular2-app.js @@ -27,7 +27,9 @@ class Angular2App extends BroccoliPlugin { options = options || {}; this._options = options; - this._sourceDir = ngConfig.defaults.sourceDir || 'src'; + this._sourceDir = options.sourceDir + || (ngConfig.defaults && ngConfig.defaults.sourceDir) + || 'src'; this._inputNode = inputNode || this._buildInputTree(); this._destDir = options.destDir || ''; diff --git a/lib/broccoli/broccoli-typescript.js b/lib/broccoli/broccoli-typescript.js index 2127625380fc..a8df2d04acc5 100644 --- a/lib/broccoli/broccoli-typescript.js +++ b/lib/broccoli/broccoli-typescript.js @@ -159,9 +159,7 @@ class BroccoliTypeScriptCompiler extends Plugin { this._tsConfigFiles = tsconfig.files.splice(0); - // the conversion is a bit awkward, see https://github.com/Microsoft/TypeScript/issues/5276 - // in 1.8 use convertCompilerOptionsFromJson - this._tsOpts = ts.parseJsonConfigFileContent(tsconfig, null, null).options; + this._tsOpts = ts.convertCompilerOptionsFromJson(tsconfig, '', null).options; this._tsOpts.rootDir = ''; this._tsOpts.outDir = '';