Skip to content

Conversation

pcfreak30
Copy link
Contributor

  • Add publicPath option to ModuleFederationOptions interface
  • Implement resolvePublicPath utility for consistent path resolution
  • Support explicit publicPath override, Vite base, and 'auto' fallback
  • Integrate with pluginMFManifest and pluginProxyRemoteEntry

I have an edge case use case where I need to have an empty base path for localhost development which would trigger the auto mode in the federation path lookup. However this causes a problem with vites base which if empty creases the html assets at ./ not / which breaks my app.

So I need the ability to override and separate them, keeping MF publicPath auto, but changing the vite base for the HTML.

@pcfreak30 pcfreak30 marked this pull request as draft August 25, 2025 04:56
Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this improvement @pcfreak30

- Add publicPath option to ModuleFederationOptions interface
- Implement resolvePublicPath utility for consistent path resolution
- Support explicit publicPath override, Vite base, and 'auto' fallback
- Integrate with pluginMFManifest and pluginProxyRemoteEntry
@pcfreak30 pcfreak30 marked this pull request as ready for review September 3, 2025 05:57
@pcfreak30
Copy link
Contributor Author

@gioboa this is ready. fixed the e2e tests.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's great to me @pcfreak30 👏

@pcfreak30
Copy link
Contributor Author

is it solving a specific issue?

Can you please clarify?

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it solving a specific issue?

@pcfreak30
Copy link
Contributor Author

is it solving a specific issue?

since GitHub borked the comments, ill repeat: Can you please clarify?

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link and close any issues with this PR ?

@pcfreak30
Copy link
Contributor Author

Can we link and close any issues with this PR ?

No. I never made an issue for this. This was unique to my situation.

@gioboa gioboa merged commit 48abe94 into module-federation:main Sep 3, 2025
4 checks passed
@pcfreak30 pcfreak30 deleted the fix/public-path branch September 3, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants