Weird result using <img src="image.svg"> in HTML
xeho91 opened this issue · 1 comments
xeho91 commented
Hi,
while using your loader, I am struggling with weird issue, which prevents me from using it.
I am using Webpack v.2.2.1.
In HTML I've got:
<img src="../../icons/font-awesome/svg/arrow_down.svg" alt="test_svg">
And after compiling and bundling, using your loader, it ends up like this:
<img src="<svg xmlns=" http:="" www.w3.org="" 2000="" svg"="" viewbox="0 0 1664 1792">
<path d="M1611 832q0 53-37 90l-651 652q-39 37-91 37-53 0-90-37l-651-652q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l294 294v-704q0-52 38-90t90-38h128q52 0 90 38t38 90v704l294-294q37-37 90-37 52 0 91 37l75 75q37 39 37 91z"></path>
" alt="test_svg">
And in my webpack config, options for this plugin:
{
loader: 'svg-inline-loader',
options: {
mimetype: 'image/svg+xml',
removeTags: false,
removingTags: ['title', 'desc', 'defs', 'style'],
removeSVGTagAttrs: false,
removingTagAttrs: [],
classPrefix: 'icon',
idPrefix: 'icon-[name]',
},
},
xeho91 commented
Edit. Close. I understood the purpose of this loader wrongly. Sorry about that.