fix(language-service): ensure correct paths are passed to TypeScript (#21812)

The 2.6 version of TypeScript's `resolveModuleName`  started to
require paths passed to be separated by '/' instead of being
able to handle '\'.

`ngc` and `ng` already do this transformation.

Fixes: #21811

PR Close #21812
This commit is contained in:
Chuck Jazdzewski
2018-01-26 14:12:46 -08:00
committed by Jason Aden
parent 778e6e759f
commit 250c8da768
3 changed files with 51 additions and 9 deletions

View File

@ -69,7 +69,7 @@ export class ReflectorHost implements StaticSymbolResolverHost {
throw new Error('Resolution of relative paths requires a containing file.');
}
// Any containing file gives the same result for absolute imports
containingFile = path.join(this.options.basePath !, 'index.ts');
containingFile = path.join(this.options.basePath !, 'index.ts').replace(/\\/g, '/');
}
const resolved =
ts.resolveModuleName(moduleName, containingFile !, this.options, this.hostAdapter)