我正在使用 Grunt Imagemin 来优化图像文件夹。但是,每次我运行该命令时,它都会在所有图像上运行 imagemin。有没有办法在检测到新更改时只运行 grunt imagemin?
最佳答案
尝试实现 grunt-newer :
Grunt Task for running tasks if source files are newer only.
在这里您可以找到 short tutorial关于如何使用它。
实现后,您应该在前面加上
newer:
到 imagemin 任务。
关于gruntjs - 在新文件上 Grunt Imagemin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23507825/