Closed a1mersnow closed 2 years ago
But If I add a same record(but replace ~
with @
) to resolve.alias
:
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
'@/': `${path.resolve(__dirname, 'src')}/`,
},
},
And replace <img src="~/static/pwa.png" />
with <img src="@/static/pwa.png" />
, it just works!
Closed because I think it's caused by vite
or @vitejs/plugin-vue
Describe the bug
In the
src/pages/index.vue
, I referencesrc/static/pwa.png
via<img src="~/static/pwa.png" />
, which report an error said:Reproduction
https://github.com/aimergenge/vitesse
System Info
Used Package Manager
pnpm
Validations