You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect bundle paths when bundles are in multiple directories. #506
Where bundles are output to more than one directory, bundle paths are incorrect.
I'm using webpack-bundle-analyser with Gatsby via gatsby-plugin-webpack-bundle-analyser-v2 which is a very thin plugin. Gatsby adds bundles to /public/, however another plugin I use gatsby-plugin-netlify-cms adds bundles to /public/admin/. When BundleAnalyzerPluginderives the bundleDir it resolves (using this.compiler.outputPath to /path/to/public/admin/ which it then uses as a prefix for all bundle paths. This means only the bundles that are generated to /admin/ are correct. The rest are not and result in warnings:
Error parsing bundle asset "/Users/me/Sites/www/public/app.js": no such file
It seems the current architecture can't handle situations where bundles are in written to different locations.
What's happening:
When you reuse the same plugin instance across multiple compilers with different output paths, the plugin only picks up the last compiler's path. So it tries looking for the first compiler's assets in the wrong folder.
Steps:
git clone https://github.com/Srushti-33/webpack-bundle-analyzer-506-repro
cd webpack-bundle-analyzer-506-repro
npm install
npm run build
Activity
valscion commentedon Apr 4, 2022
Hmm this does sound complicated and a likely bug. Would you be able to create a small reproduction so it would be possible to fix this at some point?
pionl commentedon May 9, 2022
Hi, I can confirm this.
Here a part of json I have:
Warning for the file:
It seems it ignores the
publicPath?valscion commentedon May 10, 2022
Please create a small reproduction case
pionl commentedon May 10, 2022
I'l try 👍 Thank you for your time
Srushti-33 commentedon Feb 11, 2026
@valscion @Undistraction
Just put together a minimal repro for this:
https://github.com/Srushti-33/webpack-bundle-analyzer-506-repro
What's happening:
When you reuse the same plugin instance across multiple compilers with different output paths, the plugin only picks up the last compiler's path. So it tries looking for the first compiler's assets in the wrong folder.
Steps:
fix: support multiple compilers with different output paths (webpack#506
fix: support multiple compilers with different output paths (webpack#506
alexander-akait commentedon Feb 12, 2026
@Srushti-33 thanks for debuging
fix: support multiple compilers with different output paths (webpack#506