Home

Issue: 956

Assets path resolution not working for tags different than <img>

[issue link]

I created a new Nuxt project and put files named campus.jpg and campus.mp4 inside the assets folder.
Then in my index.vue I just wrote:

<template>
  <div>
    <video autoplay muted loop poster="~assets/campus.jpg">
      <source src="~assets/campus.webm" type="video/webm">
      <source src="~assets/campus.mp4" type="video/mp4">
    </video>
  </div>
</template>

The generated code stays with the same path (i.e. http://localhost:3000/~assets/campus.jpg), so just 404 happens. The same path with <img src="~assets/campus.jpg"> works as expected.

This question is available on Nuxt.js community (#c819)