自动 CSS svg 文件 phpstorm 的 Sprite

Automated CSS Sprite of svg files phpstorm

我正在研究提供图像的最佳方式。我认为 svg 文件和 sprite 是我找到的最好的方法,我想知道是否有办法使这个过程自动化。我希望能够将 svg 文件放入一个文件夹中,并接收一个 sprite 输出文件和具有相关映射的 css 文件。

 /img
  sprite-icon.svg
/svg
  icon-facebook.svg
  icon-twitter.svg
/css
  icons.css
index.html

我正在使用 phpstorm 进行开发。

我的第一直觉是创建一个 php 脚本并附加一个文件监视器。

我该怎么办?

有很多方法可以做到这一点,但其中 none 是开箱即用的 Phpstorm - 但它确实可以很容易地通过任务运行器系统添加它们。

所以我使用的方法是使用gulp.js with the gulp-svg-sprite plugin and triggering it from Phpstorm's Gulp task runner.