core
core copied to clipboard
https://module-federation.io/configure/getpublicpath.html
Describe the bug
I think this is outdated document, I want a way to manage public path for async chunks in my webpack build I thought I can use getpublicpath for the doc but it's not available in ts types and even webpack generate error about it @ScriptedAlchemy any recommendations?
Reproduction
not required
Used Package Manager
npm
System Info
not required
Validations
- [X] Read the docs.
- [X] Read the common issues list.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Module federation issue and not a framework-specific issue.
- [ ] The provided reproduction is a minimal reproducible example of the bug.
Get public path is not released yet, but should be soon.
In the meantime you should be able to use webpack_require.p = customPath in a runtime plugin.
if(__FEDERATION__.__INSTANCES__[0].options.name !=== __webpack_require__.federation.initOptions.name) {
// this is a remote container, since host is always 0 and the names dont match
}
HI @ScriptedAlchemy,
- When do we expect the release of
getPublicPath, and is there any other way to override the publicPath in ModuleFederation?
it's taking publicPath from webpack output and I want to override that publicPath based on the runtime environment(window.publicPath), is there any way to achieve this?
- I am facing another issue which is a duplicate network request for the same chunk, one is from
federation_entry_989923ad40b99e1a8344763b664637fc_js.jsfile and another one is fromremoteEntry.jsfile
Stale issue message