How to Share Images Across Packages in Vite Module Federation with React and npm Workspaces? #18944
abuzain432432
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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