cusejuice
cusejuice

Reputation: 10681

Grunt Imagemin on New Files

I'm using Grunt Imagemin to optimize a folder of images. However everytime I run that command, it runs imagemin on ALL of the images. Is there a way to only run grunt imagemin when it detects new changes?

Upvotes: 5

Views: 1144

Answers (1)

user1625059
user1625059

Reputation:

Try implementing grunt-newer:

Grunt Task for running tasks if source files are newer only.

Here you can find a short tutorial about how to use it.

After implementing it, you should prepend newer: to the imagemin task.

Upvotes: 2

Related Questions