I'm experimenting with Laravel Vite but can't seem to figure out how to have the build command move static assets. Instead, it embeds the images "in" the css file trough base64.
So far I've figured out that you need to reference your images relative to the source .css / .scss file.
Like so in /resources/app.css
;
.arrow {
background-image: url('../img/icons/arrow.png');
}
When I run npm run build
the end result is a css file containing the image as a base64;
.arrow {
background-image: url(data:image/png;base64,xxxxxxxxxxxxxxxxxxxx);
}
My desired end result, however, would be that Vite would copy and version that exact image into /public/build/assets/img/icons/arrow.xxxxxxxxxx.png
and the processed css would be;
.arrow {
background-image: url('/build/assets/img/icons/arrow.xxxxxxxxxx.png);
}