mrsum / webpack-svgstore-plugin

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

Something weird happens to __svg__ variable #158

Closed Zyets closed 6 years ago

Zyets commented 6 years ago

// plugin will find marks and build sprite let __svg__ = {path: "./assets/svg/*.svg", name: "./assets/svg/[hash].svg"}; // require basic or custom sprite loader require("webpack-svgstore-plugin/src/helpers/svgxhr")(__svg__);

plugin overwrites to this:

var __svg__ = { filename: __webpack_require__.p +"./assets/svg/1517561561057.svg" }__svg__ = { filename: __webpack_require__.p +"./assets/svg/1517561561057.svg" };

app compilled successfully, but when i open the page in browser, i'm getting Uncaught SyntaxError: Unexpected identifier

webpack config: new SvgStore({ svgoOptions: { plugins: [{ removeTitle: true }] }, prefix: "" }),

what am i doing wrong?

Zyets commented 6 years ago

sory, my fault..