Skip to content

Commit

Permalink
fix(@ngtools/webpack): getCurrentDirectory should not return a devk…
Browse files Browse the repository at this point in the history
…it path

At the moment we are leaking devkit paths as `getCurrentDirectory` is used by the ngtsc compiler if no `rootDir` directories is provided.

`getCurrentDirectory` is also used to contruct the `rootDirs` option which is causing this to be incorrect as under Windows as `rootDirs` will be have an invalid value example: `/c/foo/bar`

This PR complements angular/angular#29151

**Note** that this currently works because we are normalizing paths with posix seperators and is mimicking the behaviour of the logical file system used by the ngtsc.

Fixes: #13849
  • Loading branch information
Alan authored and vikerman committed Mar 8, 2019
1 parent 29b1533 commit 345ab48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/compiler_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class WebpackCompilerHost implements ts.CompilerHost {
}

getCurrentDirectory(): string {
return this._basePath;
return workaroundResolve(this._basePath);
}

getCanonicalFileName(fileName: string): string {
Expand Down

0 comments on commit 345ab48

Please sign in to comment.