mrsum / webpack-svgstore-plugin

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

Combine with Webpack Dev Server #62

Closed janhoogeveen closed 8 years ago

janhoogeveen commented 8 years ago

How would you combine this package with Webpack Dev Server?

My webpack-dev-server is running on port 3001. My public app is running on port 3000.

My Publicpath is configured to a host + port so the Ajax request to the file looks like http://localhost:3000/http://localhost:3001/dist/icons/sprite.svg

I can rewrite basePath to http://localhost:3001 but then you get a request to http://localhost:3001/http://localhost:3001/dist/icons/sprite.svg

When I run a build in production mode manually (no webpack-dev-server) the publicPath is set to 'dist' and everyhing works okay.

Maybe the package could accept an override function so the publicPath does not automatically get injected into the url string?

mrsum commented 8 years ago

Hello! We can't realised this feature, cause svg concatenation action is really high CPU level action. But i think about this feature.

lgordey commented 8 years ago

@janhoogeveen Hi! Try 2.1.4 plugin version.

janhoogeveen commented 8 years ago

Hi @lgordey, I'll give it a go as soon as I can test this. Thanks for the headsup! Any specific configuration I need to be aware of?

lgordey commented 8 years ago

I think no. Unfortunately sprite will not be recreated automatically, but must work in development mode with correct paths by default.

lgordey commented 8 years ago

@janhoogeveen Hi! Check 2.2.0 version