N
Nuxt10mo ago
Anto'

Nuxt build faileld using image in css sheet

Hello guys ! I have this error when i try to build my app : 12.26 [error] Nuxt Build Error: [vite:css] [postcss] ENOENT: no such file or directory, open '/app/images/home/profit_gem.svg' I used style like this on a .vue components :
span.wins:before {
background-image: url("@/images/home/profit_gem.svg");
background-size: 16px 16px;
background-repeat: no-repeat;
content: "";
display: inline-block;
vertical-align: middle;
position: relative;
width: 16px;
height: 16px;
margin-right: 4px;
}
span.wins:before {
background-image: url("@/images/home/profit_gem.svg");
background-size: 16px 16px;
background-repeat: no-repeat;
content: "";
display: inline-block;
vertical-align: middle;
position: relative;
width: 16px;
height: 16px;
margin-right: 4px;
}
on local it work. Maybe @ is not the correct way to do that. Thanks in advance to everyone for your potentiel answer
2 Replies
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
lkjimy
lkjimy10mo ago
You can ditch the @ and just start with /, which will point to /public automatically. Make sure your public assets are in the /public folder, like @svreenen said. On the public folder: https://nuxt.com/docs/guide/directory-structure/public Docs on difference between assets and public folders: https://nuxt.com/docs/getting-started/assets#public-directory
Want results from more Discord servers?
Add your server