Skip to content

Commit b572862

Browse files
author
Bob Brinks
committed
Fix for #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 jdavidls
1 parent 0f8689b commit b572862

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,15 @@ export class WebpackCompilerHost implements ts.CompilerHost {
117117
private _resolve(path: string) {
118118
path = this._normalizePath(path);
119119
if (path[0] == '.') {
120-
return join(this.getCurrentDirectory(), path);
120+
path = join(this.getCurrentDirectory(), path);
121121
} else if (path[0] == '/' || path.match(/^\w:\//)) {
122-
return path;
122+
//return path;
123123
} else {
124-
return join(this._basePath, path);
124+
path = join(this._basePath, path);
125125
}
126+
if( fs.existsSync(path) ) // FIX symlink duplication in npm linked modules (#3875)
127+
path = fs.realpathSync(path);
128+
return path;
126129
}
127130

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

0 commit comments

Comments
 (0)