Demo Vue bug where relative
srcset
URLs are not transformed
It looks like @vue/compiler-sfc
has a bug, introduced in v3.0.0-beta.9
when adding support for absolute URLs in srcset
. This bug bypasses the transformation that would've resolved the asset URLs in srcset
.
- In an SFC template, add an
<img>
tag with asrcset
attribute, containing relative URLs with path aliases.
<img srcset="@/assets/300.png 2x, @/assets/150.png 1x">
-
Start the dev server with
yarn dev
. -
Observe no image is shown in the browser, and that the
<img>.srcset
URLs are unresolved.
<!-- expected -->
<img srcset="/src/assets/300.png 2x, /src/assets/150.png 1x">
<!-- actual -->
<img srcset="/src/@/assets/300.png 2x, /src/@/assets/150.png 1x">