Closed HerrBertling closed 2 years ago
Hi Markus!
รฎles does not alter how @vitejs/plugin-vue
extracts imports or vite
perform import analysis.
Since it works for src
in img
, it's likely that relative import detection in srcset
has a bug in Vue.
Please visit the Vue Land Discord to ask about this kind of usage, or open an issue in Vue ๐
In the meantime, you can manually import the image sources and bind them:
import someImageSrc from '@/assets/images/some_image.png'
<source :srcset="someImage" type="image/png">
@HerrBertling About your question about global CSS, the best approach is to import it in src/app.ts
. Plan to document this soon in a Recipes section in the docs.
See the following examples:
@HerrBertling This is the relevant code regarding srcset transforms in Vue.
Looks like there are several PRs open in Vue to patch this or similar problems:
Wow. Thanks for the answers โค๏ธ
iles
andvite
.Description ๐
Hey :wave: When using a
picture
element, it seems as if thesrc
for theimg
is resolved correctly, but thesrcset
attribute for differentsource
tags is not resolved when using~
or@
.Reproduction ๐
This will result in this code, at least in dev mode (haven't checked the
build
but my guess is that it's incorrect there as well):Dependencies Info
``` iles v0.6.4 vite v2.6.14 ```