Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Calling wrong url to the svg file on production #130

Open
iamrane opened this issue Feb 24, 2017 · 3 comments
Open

Calling wrong url to the svg file on production #130

iamrane opened this issue Feb 24, 2017 · 3 comments

Comments

@iamrane
Copy link

iamrane commented Feb 24, 2017

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__);
@nadavsinai
Copy link
Contributor

you need to set a base url tag in your html

@nadavsinai
Copy link
Contributor

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

@jarodtaylor
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants