nfroidure/gulp-iconfont

svg file can't be complied correctly

Closed this issue · 0 comments

uyarn commented

Hi, we use gulp-iconfont to generate a svg file from many single svg icon file. According to the guidance, the configuration is like the code below

src([iconGlob])
      .pipe(iconfontCss(fontCssConfig))
      .pipe(
        iconfont({
          fontName: 't', // required
          prependUnicode: true, // recommended option
          formats: ['ttf', 'eot', 'woff', 'svg'], // default, 'woff2' and 'svg' are available
          timestamp: runTimestamp, // recommended to get consistent builds when watching files
        }),
  )

Although the workflow has generated the svg file successfully, it can't be used and we got the error below when we opened it on browser.
image
and when we removed the xmlns attribute from the svg tag like this, it worked without any error.
<svg xmlns="http://www.w3.org/2000/svg">...</svg> ——> <svg></svg>
Anybody know how to resolve it with any configuration? oh this is a bug?