Closed ldtsch closed 2 years ago
Hi! This issue is not related to vue-inline-svg. require
is needed if you use vue-loader to handle asset's path in your .vue files.
You should consult vue-loader docs on how to properly handle assets paths.
According to this https://vue-loader.vuejs.org/guide/asset-url.html#transform-rules omitting require
should work for you.
I am writing a component library that uses SVGs imported dynamically, i.e. according to the documentation with a
:src="require(path)"
attribute. The library then gets bundled using Rollup, however, after including the library, therequire
function is not recognized. I am using Vue 3 and vue-inline-svg 3.1.0. Library code snippet:The library is then compiled by rollup with the following plugins
When including this component in the application, it will then throw the error
Has anyone seen and solved this problem before?
Thanks and Cheers