vitejs / vite-plugin-vue2

Vite plugin for Vue 2.7
MIT License
549 stars 46 forks source link

<img> inconsistency between dev and production #73

Closed kingyue737 closed 7 months ago

kingyue737 commented 1 year ago

I'm using Vuetify's <v-img> component.

<template>
  <div id="app">
    <v-img src="src/vite.svg" />
    <div>Hello World</div>
  </div>
</template>

In dev mode, it can display the image correctly: image

But after build, the following error is raised:

Failed to load resource: the server responded with a status of 404 (Not Found)    (vite.svg:1)

It seems that asset url handling didn't work on this image and thus Vite didn't copy it to outDir .

Not sure whether this inconsistency is resulted from a bug of Vite or this plugin.

minimal repo: https://stackblitz.com/edit/vitejs-vite-fmwhb6

kingyue737 commented 7 months ago

closed as Vue 2 reached EOL