webpack-spritesmith icon indicating copy to clipboard operation
webpack-spritesmith copied to clipboard

Output to Webpack's internal asset array

Open Jazcash opened this issue 7 years ago • 1 comments

Is it possible to keep the output files generated by this plugin in webpack's pipe, rather than writing to disk, making it easy to do other things with the spritesheets after they've been generated?

https://github.com/Klathmon/imagemin-webpack-plugin/issues/37#issuecomment-326554467

Jazcash avatar Mar 08 '18 15:03 Jazcash

Initially files generated by plugin were meant to be used as sources, not as final assets. With that in mind your original issue could be solved by using file-loader as in example in readme. Then file-loader would pick generated images and put them into webpack's assets, allowing other plugins to work on them.

When plugin used that way it don't make any sense to add generated images to webpack's assets. Yet when generated image IS used as final asset it indeed makes sense, also it would probably work slightly faster with webpack-dev-server.

Plugin would have to deside between these two behaviours. Via some flag in config, I guess.

So yes. It is possible, but I am not sure if it is necessary.

mixtur avatar Mar 08 '18 20:03 mixtur