Closed cairon666 closed 1 week ago
This might be related to the default value of output.publicPath
being auto
in webpack. You can try setting output.publicPath
to the same value and then see if the results are consistent.
It seems that the issue was resolved by adding output.publicPath: "auto"
. Thank you!
Version
Details
When my remote app uses Webpack, webpack_public_path is set to the path of the remoteEntry.js import. When my remote app uses RSBuild, webpack_public_path is set to window.location.origin.
As a result, when the remote app is loaded with RSBuild, the component is not loaded from the correct path.
The main application is located at http://localhost:1000/, where the host MWF is running. I need to load BugRsbuild, which is located at http://localhost:1000/static/bug-rsbuild/remoteEntry.js. After loading the remoteEntry.js, I expect that the remaining components will be loaded from the path http://localhost:1000/static/bug-rsbuild/..., but it loads everything from http://localhost:1000/..., resulting in an error.
But when use Webpack, work great:
When use rspack:
Reproduce link
https://github.com/cairon666/rsbuild-webpack-public-path-bug
Reproduce Steps