From e228f2caa6c849afa8f139939711e52a601fa0aa Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Fri, 18 Aug 2017 16:53:08 +0100 Subject: [PATCH] fix(compiler-cli): use forward slashes for ts.resolveModuleName (#18784) Windows paths have back slashes, but TypeScript expects to always have forward slashes. In other places where this call happens (like `src/compiler_host.ts`) the same fix is present. PR Close #18784 --- packages/compiler-cli/src/transformers/compiler_host.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/compiler-cli/src/transformers/compiler_host.ts b/packages/compiler-cli/src/transformers/compiler_host.ts index 74b319838d..9d07cbfc4f 100644 --- a/packages/compiler-cli/src/transformers/compiler_host.ts +++ b/packages/compiler-cli/src/transformers/compiler_host.ts @@ -61,8 +61,8 @@ class CompilerHostMixin { containingFile = path.join(this.basePath, 'index.ts'); } const resolved = ts.resolveModuleName( - m, containingFile, this.options, this.moduleResolutionHost, - this.moduleResolutionCache) + m, containingFile.replace(/\\/g, '/'), this.options, + this.moduleResolutionHost, this.moduleResolutionCache) .resolvedModule; if (resolved) { if (this.options.traceResolution) {