From a664185f2916eb13474ad9ddca45a01ec00fbddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Kostrzewski?= Date: Sun, 9 Oct 2016 22:33:21 +0200 Subject: [PATCH 1/3] Update ngc.config.js --- config/ngc.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/ngc.config.js b/config/ngc.config.js index 1237e296..8b00c649 100644 --- a/config/ngc.config.js +++ b/config/ngc.config.js @@ -1,6 +1,8 @@ module.exports = { - + compilerOptions: { + baseUrl: '.' + }, include: [ './**/*.d.ts', './app/app.module.ts', From 5d3537685ace53cc6e1278d03b5d648aed561f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Kostrzewski?= Date: Sun, 9 Oct 2016 22:34:34 +0200 Subject: [PATCH 2/3] Update ngc.ts --- src/ngc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ngc.ts b/src/ngc.ts index 7d58b441..a5c44eac 100644 --- a/src/ngc.ts +++ b/src/ngc.ts @@ -125,6 +125,9 @@ function createTmpTsConfig(context: BuildContext, ngcConfig: NgcConfig) { // force where to look for ts files tsConfig.include = ngcConfig.include; + // change baseUrl to support path mappings + tsConfig.compilerOptions.baseUrl = ngcConfig.compilerOptions.baseUrl; + // save the modified copy into the tmp directory outputJsonSync(getTmpTsConfigPath(context), tsConfig); } From c8d40a068663d63eca9ae82c5bae3fdac19e1f3d Mon Sep 17 00:00:00 2001 From: rkostrzewski Date: Sun, 9 Oct 2016 23:08:53 +0200 Subject: [PATCH 3/3] Added baseUrl to TsCompilerOptions & NgcConfig --- src/ngc.ts | 6 ++++-- src/transpile.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ngc.ts b/src/ngc.ts index a5c44eac..204452c9 100644 --- a/src/ngc.ts +++ b/src/ngc.ts @@ -6,7 +6,6 @@ import { endsWith } from './util/helpers'; import { Logger } from './util/logger'; import { getTsConfig } from './transpile'; - export function ngc(context?: BuildContext, options?: BuildOptions, ngcConfig?: NgcConfig) { context = generateContext(context); options = generateBuildOptions(options); @@ -127,7 +126,7 @@ function createTmpTsConfig(context: BuildContext, ngcConfig: NgcConfig) { // change baseUrl to support path mappings tsConfig.compilerOptions.baseUrl = ngcConfig.compilerOptions.baseUrl; - + // save the modified copy into the tmp directory outputJsonSync(getTmpTsConfigPath(context), tsConfig); } @@ -195,4 +194,7 @@ const NGC_TASK_INFO: TaskInfo = { export interface NgcConfig { include: string[]; + compilerOptions: { + baseUrl: string; + }; } diff --git a/src/transpile.ts b/src/transpile.ts index da21ce76..30ceace6 100644 --- a/src/transpile.ts +++ b/src/transpile.ts @@ -191,6 +191,7 @@ export interface TsCompilerOptions { outDir: string; removeComments: boolean; target: string; + baseUrl: string; } const ION_COMPILER_COMMENT = '/* ion-compiler */';