diff --git a/packages/ngtools/webpack/src/ivy/host.ts b/packages/ngtools/webpack/src/ivy/host.ts index 270b5d3b164c..85367d80af89 100644 --- a/packages/ngtools/webpack/src/ivy/host.ts +++ b/packages/ngtools/webpack/src/ivy/host.ts @@ -155,8 +155,13 @@ export function augmentHostWithReplacements( return; } + const normalizedReplacements: Record = {}; + for (const [key, value] of Object.entries(replacements)) { + normalizedReplacements[forwardSlashPath(key)] = forwardSlashPath(value); + } + const tryReplace = (resolvedModule: ts.ResolvedModule | undefined) => { - const replacement = resolvedModule && replacements[resolvedModule.resolvedFileName]; + const replacement = resolvedModule && normalizedReplacements[resolvedModule.resolvedFileName]; if (replacement) { return { resolvedFileName: replacement,