Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
gulp-filerev-replace
Advanced tools
Rev and replace files according to their mutual dependencies
Rev and replace files according to their mutual dependencies. This plugin accepts a stream containing all the files to filerev and/or replace. It will detect which files reference which files, and then transform the files accordingly. For example, if we filerev and replace these files:
index.html: <img src="/loader.gif" /> <link href="/styles.css" type="text/css" />
loader.gif
styles.css: body {background: url("/loader.gif")}
The process will be the following (hashes are made up for the example):
loader.gif
into loader-11111111.gif
/loader.gif
in index.html
and styles.css
styles.css
into styles-22222222.css
/styles.css
in index.html
index.html
into index-33333333.html
Notice that loader.gif
is filereved first, since it is referenced the most, then styles.css
and finally index.html
. The resulting stream will be:
loader-11111111.gif
styles-22222222.css: body {background: url("/loader-11111111.gif")}
index-33333333.html: <img src="/loader-11111111.gif" /> <link href="/styles-22222222.css" type="text/css" />
var filerevReplace = require('gulp-filerev-replace');
// Include all files to filerev and/or replace, making sure the base is correct
gulp.src('/mysite/**/*', {base: '/mysite'})
.pipe(filerevReplace({
filerev: ['assets/**/*'], // Select the files to filerev
replace: ['views/**/*'], // Select the files to replace
base: 'assets' // Filerevved files are served from the assets directory by the web server
}))
...
filerev
: minimatch pattern to filter the files to filerev.replace
: minimatch pattern to filter the files to replace.base
: Directory from where the files are served by the web server. Optional, defaults to the file's base;A second plugin is also available that adds a new file to the stream. This file contains a JSON list of all files that were filereved.
var filerevReplace = require('gulp-filerev-replace');
// Include all files to filerev and/or replace, making sure the base is correct
gulp.src('/mysite/**/*', {base: '/mysite'})
.pipe(filerevReplace({
filerev: ['assets/**/*'], // Select the files to filerev
replace: ['views/**/*'], // Select the files to replace
base: 'assets' // Filerevved files are served from the assets directory by the web server
}))
.pipe(filerevReplace.addManifest({path: 'assets/filerev.json'}))
...
The example above would add a new file in the stream, with path assets/filerev.json
, containing something like:
{
"assets/loader.gif": "assets/loader-11111111.gif",
"assets/styles.css": "assets/styles-22222222.css"
}
options
is an object containing the vinyl file options to use for the manifest file. It defaults to:
path
: filerev-replace-manifest.json
FAQs
Rev and replace files according to their mutual dependencies
We found that gulp-filerev-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.