ModuleFederationPlugin load chunks only from root directory
See original GitHub issueFeature request
I don’t know if you considere this as a bug or a feature. I used the ModuleFederationPlugin, but places the remoteEntry.js in some subfolders on my express-server, so the url to the file is something like:
http://localhost/sub/folder/remoteEntry.js
I want to load remotes dynamically like in: https://github.com/module-federation/module-federation-examples/tree/7930cd5452555928801e1550f836ffe3d438a66b/advanced-api/dynamic-remotes
When I load the remoteEntry from the url, I got the following error: ChunkLoadError: Loading chunk 517 failed.
, because webpack tries to load it from the following url:
http://localhost:8000/517.bundle.js
instead of
http://localhost:8000/sub/folder/517.bundle.js
What is the expected behavior? Webpack should load the chunk from
http://localhost:8000/sub/folder/517.bundle.js
What is motivation or use case for adding/changing the behavior? Javascript-files often placed in subfolder to keep the root directory clean.
How should this be implemented in your opinion? There could be an option in the ModuleFederationPluginConfiguration to set the path.
Are you willing to work on this yourself? maybe
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Thank you, “publicPath” was the option I’m looking for!
You have publicPath, if you need help please provide reproducible example, otherwise nobody can help you