vite-plugin-vue2 icon indicating copy to clipboard operation
vite-plugin-vue2 copied to clipboard

`srcset` attribute of img is compiled to `requrie(xxx)` in vite build

Open daolanfler opened this issue 1 year ago • 5 comments

I was migrating a vue2/vue-cli project to vite. In the production build, I found this requrie is not defined error in devtools console. image

I find that srcset is handled in @vue/compiler-sfc 's this file it transforms srcset="" to require("") , causing the above error. I don't think that's an expected behaviour.

Also in dev mode, using vite-inspect I found there was no such transform

image

Reproduction link

minimum reproduction link

daolanfler avatar Apr 01 '23 07:04 daolanfler