New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-resolve-dependencies

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-resolve-dependencies - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

test/expected/filtered.js

8

index.js

@@ -51,2 +51,10 @@ 'use strict';

if (!filePath) {
if (config.log) {
Log('[' + AnsiColors.green(PLUGIN_NAME) + '] Ignored', match[1]);
}
continue;
}
// Check for circular dependencies

@@ -53,0 +61,0 @@ try {

3

package.json
{
"name": "gulp-resolve-dependencies",
"version": "3.0.1",
"version": "4.0.0",
"description": "Resolve dependency directives in assets (e.g. \"@requires\" or \"//= require\" in JavaScript)",

@@ -12,3 +12,2 @@ "license": "MIT",

"scripts": {
"pretest": "npm i",
"test": "./node_modules/mocha/bin/mocha"

@@ -15,0 +14,0 @@ },

@@ -53,3 +53,3 @@ # gulp-resolve-dependencies

`gulp.src` will not necessarily return files in a [deterministic way](https://github.com/gulpjs/gulp/issues/687). If this turns out to be an issue, using a plugin like [`gulp-sort`](https://www.npmjs.com/package/gulp-sort) or [`gulp-rder`](https://www.npmjs.com/package/gulp-order) right after `gulp.src` might be an option for you. Thanks to @fabiospampinato for [pointing this out](https://github.com/backflip/gulp-resolve-dependencies/issues/10).
`gulp.src` will not necessarily return files in a [deterministic way](https://github.com/gulpjs/gulp/issues/687). If this turns out to be an issue, using a plugin like [`gulp-sort`](https://www.npmjs.com/package/gulp-sort) or [`gulp-order`](https://www.npmjs.com/package/gulp-order) right after `gulp.src` might be an option for you. Thanks to @fabiospampinato for [pointing this out](https://github.com/backflip/gulp-resolve-dependencies/issues/10).

@@ -81,2 +81,14 @@ ## API

Returning a falsy value will ignore the resolved path:
```javascript
function(match, targetFile) {
// Ignore `/lib.js`
if (match.match(/\/lib\.js$/)) {
return null;
}
return path.join(path.dirname(targetFile.path), match);
}
```
#### options.log

@@ -83,0 +95,0 @@ Type: `Boolean`

@@ -92,2 +92,23 @@ var gulp = require('gulp'),

});
it('should ignore lib2.js', function(done) {
gulp.src(__dirname + '/fixtures/main.js')
.pipe(resolveDependencies({
resolvePath: function(match, targetFile) {
// Ignore specific matches
if (match.match(/\/lib2\.js$/)) {
return null;
}
return path.join(path.dirname(path.resolve(targetFile.path)), match);
},
log: true
}))
.pipe(concat('filtered.js'))
.pipe(gulp.dest(__dirname + '/results/'))
.pipe(es.wait(function() {
assertFilesEqual('filtered.js');
done();
}));
});
});
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