L
Lewis Peel
Guest
Lewis Peel Asks: Images from dependencies not loading
I have a dependency that uses its own images. When building with Vite, the images go into
If I open that in the browser I get a reference back to the library;
But the app fails to load the image. If I remove
Is there a way to configure vite.config.js to fix this?
I have a dependency that uses its own images. When building with Vite, the images go into
build/assets/[name]-[hash][extname]
as I would expect, but when my application requests the images it's adding ?import
to the end of the file name which results in the path;http://localhost:3030/node_modules/@foo/library/static/images/image.png?import
If I open that in the browser I get a reference back to the library;
export default "/node_modules/@foo/library/static/images/image.png"
But the app fails to load the image. If I remove
?import
from the url in the browser, the image loads.Is there a way to configure vite.config.js to fix this?