-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Bug report
PR #19434 broke how chunks are loaded when they have a directory segment in the output.filename. The tests in the PR don't sufficiently test that the output is correct. This breaks esm imports in webpack 5.99.6 and above. This problem was correctly identified in #19495 but dismissed, claiming that the /./ in the final path is not an issue.
What is the current behavior?
The concatenated url is incorrect. It includes both the publicPath, which is absolute to the server, and the relative path based on the current chunk file. The combination is nonsensical unless the current chunk is placed in the root directory.
If the current behavior is a bug, please provide the steps to reproduce.
The issue is reproducible in this simple test case: https://github.com/mariusGundersen/webpack-module-publicPath-issue.
What is the expected behavior?
The path to the chunk should not depend on the current chunk location, since it uses the publicPath, which makes the lookup incorrect. The rootOutputDir should only be used when publicPath is auto.
Other relevant information:
webpack version: 5.99.8
Node.js version: 22.6.0
Operating System: Windows and Linux