Open yckimura opened 9 months ago
Until it is fixed, the following workarounds are available:
<script setup>
import assets from '~/assets/logo.svg'
</script>
<template>
<div>
<img :src="assets" width="100" height="100" />
</div>
</template>
<template>
<div>
<img src="@/assets/logo.svg" width="100" height="100" />
</div>
</template>
Any progress?
I think this is an issue with the vite plugin. https://github.com/vitejs/vite-plugin-vue2/issues/59
Environment
@nuxt/bridge@3.0.0-rc.3-28343365.3c40b3f
Reproduction
https://stackblitz.com/edit/nuxt-starter-abfxvv
Describe the bug
Asset urls prefixed with tilde (
~/
) in template are not resolving correctly when building withvite: true
./_nuxt/assets/logo.svg
/_nuxt/pages/assets/logo.svg
nuxt.config.js
:pages/index.vue
:Output:
Additional context
No response
Logs
No response