mrsum/webpack-svgstore-plugin

Calling wrong url to the svg file on production

Opened this issue · 3 comments

When i try it on dev it works perfect, when Im trying this on production its calling with a weird url.
https://www.mydomaincom/https://www.mydomaincom/static/1487869309421.icons.svg

webpack.base.js

var SvgStore = require('webpack-svgstore-plugin');
var plugins = [
new SvgStore.Options({
  svgoOptions: {
    plugins: [
      { removeDesc: true },
      { removeAttrs: { attrs: 'fill|class|style' } },
      { removeStyleElement: true },
      { removeRasterImages: true },
     { sortAttr: true }
  ]
}})

in my js

var __svg__ = {path: '../../../styles/images/svg-icons/**/*.svg', name: '[hash].icons.svg'};
require('webpack-svgstore-plugin/src/helpers/svgxhr')(__svg__);

you need to set a base url tag in your html

my mistake, looking at the code it seems that the public url by webpack config is what's used here, so set that accordingly see 37880b3

I'm having this same issue and @nadavsinai I'm not quite sure I understand what your solution is/was.