Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-rev-all

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-rev-all - npm Package Compare versions

Comparing version 0.8.4 to 0.8.5

2

package.json
{
"name": "gulp-rev-all",
"version": "0.8.4",
"version": "0.8.5",
"description": "Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn.098f6bcd.css, also re-writes references in each file to new reved name.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -153,3 +153,3 @@ # [gulp](https://github.com/wearefractal/gulp)-rev-all [![Build Status](https://travis-ci.org/smysnk/gulp-rev-all.png?branch=master)](https://travis-ci.org/smysnk/gulp-rev-all)

Don't rename file or update refrences in files matching these rules
Don't rename, search or update refrences in files matching these rules
Type: `Array of (Regex and/or String)`

@@ -170,3 +170,8 @@ Default: `[ /^\/favicon.ico$/ ]`

#### options.dontSearchReference
Don't search for references in files matching these rules
Type: `Array of (Regex and/or String)`
Default: `[]`
In some cases, you may not want to rev your `*.html` files:

@@ -173,0 +178,0 @@

@@ -17,2 +17,3 @@ var gracefulfs = require('graceful-fs');

'dontUpdateReference': [],
'dontSearchReference': [],
'fileNameVersion': 'version.json',

@@ -127,4 +128,4 @@ 'fileNameManifest': 'rev-manifest.json',

// Don't try and resolve references in binary files
if (this.Tool.is_binary_file(fileResolveReferencesIn)) return;
// Don't try and resolve references in binary files or files that have been blacklisted
if (this.Tool.is_binary_file(fileResolveReferencesIn) || !this.shouldSearchReference(fileResolveReferencesIn)) return;

@@ -327,2 +328,26 @@ var referenceGroupRelative = [];

/**
* Determines if a particular reference should be updated across assets based on dontUpdateReference supplied in options.
*/
Revisioner.prototype.shouldSearchReference = function (file) {
var filename = this.Tool.get_relative_path(file.base, file.path);
for (var i = this.options.dontGlobal.length; i--;) {
var regex = (this.options.dontGlobal[i] instanceof RegExp) ? this.options.dontGlobal[i] : new RegExp(this.options.dontGlobal[i] + '$', 'ig');
if (filename.match(regex)) {
return false;
}
}
for (var i = this.options.dontSearchReference.length; i--;) {
var regex = (this.options.dontSearchReference[i] instanceof RegExp) ? this.options.dontSearchReference[i] : new RegExp(this.options.dontSearchReference[i] + '$', 'ig');
if (filename.match(regex)) {
return false;
}
}
return true;
};
return Revisioner;

@@ -329,0 +354,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc