Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 1 KB

README.md

File metadata and controls

24 lines (15 loc) · 1 KB

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.

Steps to reproduce:

  1. In an SFC template, add an <img> tag with a srcset attribute, containing relative URLs with path aliases.
<img srcset="@/assets/300.png 2x, @/assets/150.png 1x">
  1. Start the dev server with yarn dev.

  2. 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">