mixtur / webpack-spritesmith

Webpack plugin that converts set of images into a spritesheet and SASS/LESS/Stylus mixins
499 stars 56 forks source link

Support for image min #75

Closed Truemedia closed 5 years ago

Truemedia commented 6 years ago

https://www.npmjs.com/package/imagemin

Hi, I used to use gulp spritesmith before webpack became quite standard as a build tool. In my old solution with the image and css streams I was able to pipe to compression plugins, the most crucial being imagemin.

With image min I was able to compress my sprite image to 10 times smaller space which is extremely useful when you have a massive sprite.

Would it be possible to add imagemin as an option and then also specify the plugin (pngquant is best for size but sometimes causes artifacts).

mixtur commented 6 years ago

If both your css and images are going through webpack you should easily be able to add imagemin to your pipeline.

Config in readme already already does that for you. You will only have to add something like https://www.npmjs.com/package/imagemin-webpack or https://www.npmjs.com/package/imagemin-webpack-plugin

Truemedia commented 6 years ago

@mixtur Ah ok, interesting I will give that a try thanks

mixtur commented 5 years ago

Closing due to inactivity