khalyomede / gulp-sharp-responsive

A gulp plugin to generate responsives images.
https://npmjs.com/package/gulp-sharp-responsive
17 stars 6 forks source link

Add support for `gulp-cache` #1

Closed chenaski closed 3 years ago

chenaski commented 3 years ago

https://github.com/jgable/gulp-cache#one-to-many-caching

khalyomede commented 3 years ago

Interesting! Thanks for the link. I am just wondering, since in the documentation it seems this is not a built-in feature of Gulp, shouldn't you include the package in package.json and import it in the script as well?

chenaski commented 3 years ago

Yes, this is not a built-in feature, but sometimes gulp plugins add extra fields to the Vinyl file to pass additional data that the following plugins can use. For example: gulp-data. I think it's one of the reasons why the gulp guidelines [12] recommends using file.clone.

There is no need to include the gulp-cache package because we just need to store the cachedKey field this plugin adds to identify the file.

khalyomede commented 3 years ago

This merge request is part of v0.2.0.