From d3eee5a5c8d047aff399af0ea39f36c24e6fc937 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 7 Aug 2018 17:22:30 -0400 Subject: [PATCH] fix(@ngtools/webpack): resolve relative host replacement paths Fixes: #11801 --- packages/ngtools/webpack/src/angular_compiler_plugin.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/ngtools/webpack/src/angular_compiler_plugin.ts b/packages/ngtools/webpack/src/angular_compiler_plugin.ts index faebb2f56988..fad93d665352 100644 --- a/packages/ngtools/webpack/src/angular_compiler_plugin.ts +++ b/packages/ngtools/webpack/src/angular_compiler_plugin.ts @@ -597,8 +597,11 @@ export class AngularCompilerPlugin { replacements = new Map(); const aliasHost = new virtualFs.AliasHost(host); for (const from in this._options.hostReplacementPaths) { - const normalizedFrom = normalize(from); - const normalizedWith = normalize(this._options.hostReplacementPaths[from]); + const normalizedFrom = resolve(normalize(this._basePath), normalize(from)); + const normalizedWith = resolve( + normalize(this._basePath), + normalize(this._options.hostReplacementPaths[from]), + ); aliasHost.aliases.set(normalizedFrom, normalizedWith); replacements.set(normalizedFrom, normalizedWith); }