-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GetPublicPath from federation options #104
Comments
understand |
@judithhartmann we are working on it. can you create an example based on this example of these special config pls? |
I will. I also saw in your PR that there seems to be a static public path option that i did not find in the docs, I will try that as well. The issue i ran into my project is that we have the modules in a cdn but the remoteEntry was trying to load the |
Thanks, with your example we can certify the new implementation 👏 |
I tried to build an example from your PR #108, unfortunately i got stuck because getPublicPath does not seem to be applied. I would assume i'll find something related to it in the build output of the remote. |
Yep, the PR it's not complete yet. I was waiting for the test case. Can you share with me your configurations please ? It's |
Here are all my modifications I modified the vite dev and preview server, so they will serve all files with the Basically the test would be, that every file requested from the host from this remote (not just remoteEntry.js) also contains the custom prefix. |
@judithhartmann I'm wondering if we can consider using the Vite experimental.renderBuiltUrl configuration instead of supporting the |
it looks like this might work however, from user perspective, since since plugin does not have it's own extensive docs, but relies on https://module-federation.io/ it might be confusing, as getPublicPath is documented over there to achieve this behaviour |
Yup, you are right, we can add a section in the README for that. Would you like to drop a PR for that? |
I added a warning |
Even if experimental.renderBuiltUrl is set, manifest.json still needs to have |
Hi @gioboa, sorry for the delay. I tried out the experimental.renderBuiltUrl. (Branch) experimental: {
renderBuiltUrl: (filename) => {
return `http://localhost:4001/custom-prefix/${filename}`;
},
}, Unfortunately the only place where i can find the In the vite dev example, all files aside from the remoteEntry.js where loaded without the prefix combined with @zhangHongEn concerns, i think we need to reopen this. |
if i set the base in the vite config (which works for static paths), i can see the custom-prefix here in
|
Currently setting
getPublicPath
in the plugin config seems to have no effect (I could not find the function i passed there anywhere in my build output).Expected behaviour described here:
https://module-federation.io/configure/getpublicpath.html
The text was updated successfully, but these errors were encountered: