sindresorhus / gulp-rev

Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`
MIT License
1.54k stars 217 forks source link

Usage of file.revOrigPath option #156

Closed kozlitinaelja closed 8 years ago

kozlitinaelja commented 8 years ago

Can you, please, provide how to use file.revOrigPath? I think it may be useful for me but I can't figure out how to enable it.

benbieler commented 8 years ago

Hello @kozlitinaelja. The file.revOrigPath option ist indeed very usefull ;) Basically you get the file from a callback function. On this you then can use the revOrigPath option.

Usage example:

var through = require('through2');

var foo = function () {
  return through.obj(function(file, enc, cb) {
      // Here you can use: file.revOrigPath
  };
}

Here it is used as well I hope this helps...