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

[bug] asset starts with '~@' resolved error

Open JonathanLee-LX opened this issue 2 years ago • 1 comments

asset starts with '~@' resolved error

example

src/bar/foo.vue

<template>
   <img src='~@assets/foo.png'/>
</template>

compiled

// actually 
/src/bar/@assets/foo.png

// expected
src/assets/foo.png

vite.config.ts

import vue from '@vitejs/plugin-vue2'
import { defineConfig } from 'vite'

defineConfig({
  plugins: [vue()],
})

JonathanLee-LX avatar Oct 16 '22 17:10 JonathanLee-LX

I think it should be caused by this line of code

https://github.com/vitejs/vite-plugin-vue2/blob/06ede94bcc1b639f01b0defb5cbfd287052cde83/src/template.ts#L117

JonathanLee-LX avatar Oct 16 '22 17:10 JonathanLee-LX