core icon indicating copy to clipboard operation
core copied to clipboard

https://module-federation.io/configure/getpublicpath.html

Open alyahmedaly opened this issue 1 year ago • 2 comments
trafficstars

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

alyahmedaly avatar Apr 30 '24 11:04 alyahmedaly

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
}

ScriptedAlchemy avatar May 01 '24 04:05 ScriptedAlchemy

HI @ScriptedAlchemy,

  1. When do we expect the release of getPublicPath, and is there any other way to override the publicPath in ModuleFederation?
image

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?

  1. I am facing another issue which is a duplicate network request for the same chunk, one is from federation_entry_989923ad40b99e1a8344763b664637fc_js.js file and another one is from remoteEntry.js file

satheesh66 avatar May 31 '24 07:05 satheesh66

Stale issue message

github-actions[bot] avatar Jul 30 '24 15:07 github-actions[bot]