sindresorhus / gulp-rev

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

support gulp-sourcemaps #75

Closed goldibex closed 9 years ago

goldibex commented 9 years ago

This pull request adds support for gulp-sourcemaps. It holds on to sourcemaps (i.e. files ending in .map) until the flush phase, where it checks to see if there's an associated source file. If there is, it uses the source file's hash; if not, it generates a new hash for the file as usual.

Tests and documentation are also updated.

goldibex commented 9 years ago

Fixed up your requested changes @sindresorhus .

An aside on why I had added the sourcemapDestPath option: I didn't realize at the time that I could get the path to the original file through the file property in the sourcemap JSON. I changed the code to parse the sourcemap and get the property, so sourcemapDestPath is no longer necessary.

sindresorhus commented 9 years ago

Closing in favor of https://github.com/sindresorhus/gulp-rev/pull/77