Skip to content

Commit 18b1e83

Browse files
authored
Update compiler_host.ts
Fix for angular#3875 The problem: duplication of symlinked source files (npm linked sources) in CompilerHost's stats. The solution: resolve these paths before of all Gift of kings
1 parent 45e2985 commit 18b1e83

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/@ngtools/webpack/src/compiler_host.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,15 @@ export class WebpackCompilerHost implements ts.CompilerHost {
109109
private _resolve(path: string) {
110110
path = this._normalizePath(path);
111111
if (path[0] == '.') {
112-
return join(this.getCurrentDirectory(), path);
112+
path = join(this.getCurrentDirectory(), path);
113113
} else if (path[0] == '/' || path.match(/^\w:\//)) {
114-
return path;
114+
//return path;
115115
} else {
116-
return join(this._basePath, path);
116+
path = join(this._basePath, path);
117117
}
118+
if( fs.existsSync(path) ) // FIX symlink duplication in npm linked modules (#3875)
119+
path = fs.realpathSync(path);
120+
return path;
118121
}
119122

120123
private _setFileContent(fileName: string, content: string) {

0 commit comments

Comments
 (0)