mrsum / webpack-svgstore-plugin

Simple svg-sprite creating with webpack
https://www.npmjs.com/package/webpack-svgstore-plugin
200 stars 92 forks source link

change the ajax path request? #135

Closed romanmarkelov closed 7 years ago

romanmarkelov commented 7 years ago

Hi! How change the ajax path request?

webpack 2.1.0
webpack-svgstore-plugin 4.0.0

my solution:

// app.js
const __svg__  = { path: './../img/svg/**/*.svg', name: 'svg/[hash].sprite.svg' };
  require('webpack-svgstore-plugin/src/helpers/svgxhr')({ filename: `app/dist/${__svg__.filename }`});

maybe there's an even better option ?

AndreKelling commented 7 years ago

saved my day! found no better option.

doing it with path's like: new SvgStore(path.join(__dirname + '/src', 'icons', '**/*.svg'), path.join('assets', 'svg'), { name: '[hash].sprite.svg', prefix: 'myprefix-', svgoOptions: { // options for svgo, optional } }) wasn't somehow not working for me.