diff --git a/components/webpack/webpack-plugin-depfile.js b/components/webpack/webpack-plugin-depfile.js index 41a2ada95f8..1f2ce222720 100644 --- a/components/webpack/webpack-plugin-depfile.js +++ b/components/webpack/webpack-plugin-depfile.js @@ -36,7 +36,11 @@ class GenerateDepfilePlugin { // These hooks cannot be used async, so must do sync ops. compiler.hooks.compilation.tap(this.constructor.name, (compilation) => { compilation.hooks.finishModules.tap(this.constructor.name, (modules) => { - const absoluteDepsPaths = Array.from(modules).map(module => module.resource) + // Resolve all symlinks/junctions to real paths. Siso doesn't handle + // junctions on Windows well, so we need to resolve them here. + const absoluteDepsPaths = Array.from(modules) + .filter(module => module.resource) + .map(module => fs.realpathSync(module.resource)) const depfileContent = generateDepfileContent(this.options.depfileSourceName, absoluteDepsPaths) writeDepfileContentSync(this.options.depfilePath, depfileContent) })