How to Share Images Across Packages in Vite Module Federation with React and npm Workspaces? #18944
zain-bin-ramzan
started this conversation in
General
Replies: 1 comment
-
Any advice here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Vite module federation with npm workspaces in a mono repo setup.
I have two packages, both named header. In the header package, I use an image that is publicly served by that package. When I preview or build the header package, the image displays correctly. However, when I consume the header component in the shell application, the image is missing because it is not publicly served by the shell package.
My question is: How can I ensure that any image used by a package is automatically served along with the component, so it works seamlessly when consumed in any other package or application?
Beta Was this translation helpful? Give feedback.
All reactions