I am using vite to build my assets and this works fine except for the background images.
Example:
<img src="/img/ruben.jpg" alt="Ruben">
Works and has as url: http://mylocalsite.nl.test/img/ruben.jpg which is good.
But this:
&:before{
content: "";
background-image: url('/img/svg/echtveilig-beeldmerk.svg');
}
Has as url: http://127.0.0.1:5173/img/svg/echtveilig-beeldmerk.svg which is the local server started by vite but I don't want that, I just want the same url as for image tags. How can I fix that?
I tried creating a file 'postcss.config.js' and adding:
module.exports = {
plugins: {
autoprefixer: {},
},
};
But this does not work.
My package json:
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"sass": "^1.50.1",
"sass-loader": "^12.1.0",
"vite": "^4.0.0"
},
"dependencies": {
"bootstrap": "^5.3.0-alpha1",
"autoprefixer": "^10.4.8",
"swiper": "^8.1.3"
}
}