A gulp-rev subresource integrity plugin
npm install gulp-rev-sri






> A gulp-rev subresource integrity plugin
* Install
* Usage
* Options
* Contributors
* License
[npm][]:
``sh`
npm install gulp-rev-sri
[yarn][]:
`sh`
yarn add gulp-rev-sri
`js
const gulp = require('gulp');
const rev = require('gulp-rev');
const revSri = require('gulp-rev-sri');
gulp.src('./myassets/*/')
.pipe(rev())
.pipe(gulp.dest('./somedestination/'))
.pipe(rev.manifest())
.pipe(revSri({ base: 'some/build/path', manifestName: 'sri-manifest.json' }))
.pipe(gulp.dest('./somedestination/'))
.on('end', () => { ... });
// sri-manifest.json
// {
`
* base - base file path for build filesmanifestName
* (default: sri-manifest.json) - name of the manifest file being created (_Warning_ do not use rev-manifest.json)
_Warning_: The original rev-manifest.json is in the format:
`json`
{
"
"
...
}
while the new sri format couples a file path with it's integrity hash in the new format of:
`json`
{
"
"path": "
"integrity": "sha256-
},
"
"path": "
"integrity": "sha256-
},
...
}
_It's recommended that you choose a different file name from rev-manifest.json` due to potential complications in merging existing files._
| Name | Website |
| --------- | ------------------------- |
| Shaun |
##
[npm]: https://www.npmjs.com/
[yarn]: https://yarnpkg.com/