webpack-svgstore-plugin
webpack-svgstore-plugin copied to clipboard
Calling wrong url to the svg file on production
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 https://github.com/mrsum/webpack-svgstore-plugin/pull/110/commits/37880b357bddead285a046e8abbaef1f318c93dd
I'm having this same issue and @nadavsinai I'm not quite sure I understand what your solution is/was.