Static GitHub Issues

[2099] path to assets folder is not resolved when using <object>/<embed>

prev: How to extract common mutations between modules?
next: Extending the VueRouter instance

If I reference a SVG assets, e.g. ~/assets/svg/list.svg using an <object> or <embed>, vue-loader does not resolve the path. If use an <img> tag, everything is fine.

Output: <object src="~/assets/svg/list.svg"></object>

<img src="/_nuxt/img/list.e48b737.svg">

Steps to reproduce:

  1. Create a page (whatever.vue) in the pages folder
  2. Create a <template> in whatever.vue
  3. Download the attached ZIP file and extract it into the assets folder. svg.zip
  4. Inside the template, put <ol><li><object src="~/assets/svg/list.svg"></object></li><li><img src="~/assets/svg/list.svg"></li></ol>
  5. Observe that the first item does not render whereas the second does.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1862">#c1862</a>)</em></sub></div>