-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Bug report
What is the current behavior?
This is a minimal example to showcase a problem with webpack5 and es modules async chunk loader.
Here's the reproduction codebase: https://stackblitz.com/edit/webpack-webpack-js-org-kxd532jl?file=README.md
It seems like publicPath is not being properly respected when loading chunks.
To test this out:
- npm run build
- npm start
npm start will run two servers:
- the main distribution folder with the html file pointing to the main entry output
main.js - the public folder containing all the chunks generated (port 9010)
If you try to access the application, if everything goes well you should see the number 1 on the page.
This won't happen in this case as webpack will try to access the chunk without properly following publicPatch (publicPath is pointing to http://localhost:9010/)
What is the expected behavior?
The expected behavior would be for the publicPath to be properly concatenated on the start of the chunk loading mechanism.
Other relevant information:
webpack version: 5.99.5
Node.js version: 20.19.0
Operating System: Windows
Additional tools: