Gathering detailed insights and metrics for @formunauts/gulp-rev-rewrite
Gathering detailed insights and metrics for @formunauts/gulp-rev-rewrite
npm install @formunauts/gulp-rev-rewrite
Typescript
Module System
Min. Node Version
Node Version
NPM Version
67.7
Supply Chain
98.2
Quality
75.2
Maintenance
100
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
2,607
Last Day
2
Last Week
3
Last Month
8
Last Year
97
116 Commits
1 Watching
1 Branches
8 Contributors
Minified
Minified + Gzipped
Latest Version
1.2.0
Package Id
@formunauts/gulp-rev-rewrite@1.2.0
Unpacked Size
10.42 kB
Size
4.12 kB
File Count
5
NPM Version
6.9.0
Node Version
12.4.0
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
200%
3
Compared to previous week
Last month
-20%
8
Compared to previous month
Last year
-61.8%
97
Compared to previous year
3
7
Rewrite occurrences of filenames which have been renamed by gulp-rev
This plugin is an improved and maintained fork of gulp-rev-replace.
npm install gulp-rev-rewrite --save-dev
Only LTS and current releases of Node are supported.
Pipe through a stream with both the revved files and the files containing references to them.
1const gulp = require('gulp'); 2const filter = require('gulp-filter'); 3const rev = require('gulp-rev'); 4const revRewrite = require('gulp-rev-rewrite'); 5 6gulp.task('rev', () => { 7 const assetFilter = filter(['**/*', '!**/index.html'], { restore: true }); 8 9 return gulp.src('src/**') 10 .pipe(assetFilter) 11 .pipe(rev()) // Rename all files except index.html 12 .pipe(assetFilter.restore) 13 .pipe(revRewrite()) // Substitute in new filenames 14 .pipe(gulp.dest('dist')); 15});
It is also possible to collect the revisioned filenames from JSON manifests written out by gulp-rev
. This allows for replacing filenames that were revved prior to the current task.
1const rev = require('gulp-rev'); 2const revRewrite = require('gulp-rev-rewrite'); 3const revDelete = require('gulp-rev-delete-original'); 4 5gulp.task('revision', ['dist:css', 'dist:js'], () => { 6 return gulp.src('dist/**/*.{css,js}') 7 .pipe(rev()) 8 .pipe(revDelete()) // Remove the unrevved files 9 .pipe(gulp.dest('dist')) 10 .pipe(rev.manifest()) 11 .pipe(gulp.dest('dist')); 12}); 13 14gulp.task('revRewrite', ['revision'], function() { 15 const manifest = gulp.src('dist/rev-manifest.json'); 16 17 return gulp.src('dist/index.html') 18 .pipe(revRewrite({ manifest })) 19 .pipe(gulp.dest('dist')); 20});
Type: Object
Type: Boolean
Default: true
Use canonical URIs when replacing filePaths, i.e. use a forward slash (/
) as the path segment seperator.
Type: Array
Default: ['.js', '.css', '.html', '.hbs']
Only substitute in new filenames in files of these types.
Type: Boolean
Default: true
Replace relative files like url(../image/foo.jpg)
in files with reved filename.
Type: String
Add a prefix to each replacement.
Type: Stream
(e.g., gulp.src()
)
Read JSON manifests written out by rev
. Allows replacing filenames that were
revved prior to the current task.
Type: Function
Modify the name of the unreved/reved files before using them. The function receives the unreved/reved filename as the first argument, and the Vinyl object of the current file as the optional second argument.
For example, if in your manifest you have:
1{"js/app.js.map": "js/app-98adc164.js.map"}
If you wanted to get rid of the js/
path just for .map
files (because they
are sourcemaps and the references to them are relative, not absolute) you could
do the following:
1function replaceJsIfMap(filename) { 2 if (filename.includes('.map')) { 3 return filename.replace('js/', ''); 4 } 5 return filename; 6} 7 8return gulp.src('dist/**/*.js') 9 .pipe(revRewrite({ 10 manifest: manifest, 11 modifyUnreved: replaceJsIfMap, 12 modifyReved: replaceJsIfMap 13 })) 14 .pipe(gulp.dest('dist'));
MIT © James K Nelson, Thomas Vantuycom
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More