![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
gulp-dependency-directive
Advanced tools
Readme
A Gulp 4 compatible fork of gulp-resolve-dependencies. All credit due to Thomas Jaggi.
Resolve dependency directives in assets, e.g.
@depend
(Juicer) or//= require
(Sprockets)). Inspired by grunt-concat-in-order. Useful in combination with gulp-concat.
First, install gulp-dependency-directive
as a development dependency:
npm install --save-dev gulp-dependency-directive
Then, add it to your gulpfile.js
(probably together with gulp-concat):
var resolveDependencies = require('gulp-dependency-directive');
var concat = require('gulp-concat');
gulp.task('js', function(){
gulp.src(['app/assets/js/main.js'])
.pipe(resolveDependencies({
pattern: /\* @requires [\s-]*(.*\.js)/g
}))
.on('error', function(err) {
console.log(err.message);
})
.pipe(concat())
.pipe(gulp.dest('dest/assets/js/'));
});
And use the directives in your JS files (dependencies can be nested, they are handled recursively):
/**
* @requires libs/jquery/jquery.js
* @requires ../modules/slideshow/slideshow.js
*/
(function(window, document, $, undefined) {
'use strict';
$(document).on('ready', function() {
$('.slideshow').slideshow();
});
})(window, document, jQuery);
Warning: This might not be very efficient (especially in case of nested dependencies). Some kind of caching mechanism could come in handy.
Circular dependencies are either silently ignored or emit an error. See options.ignoreCircularDependencies
below.
Type: RegExp
The matching pattern (defaults to /\* @requires [\s-]*(.*?\.js)/g
).
Type: Function
Resolver for matched paths. Default:
function(match, targetFile) {
return path.join(path.dirname(targetFile.path), match);
}
Parameters:
match
{String} Matched file path (in the example above this would be libs/jquery/jquery.js
and ../modules/slideshow/slideshow.js
, respectively)targetFile
{Vinyl file object} Currently parsed file (where the matches were found)The path
package is available in this context.
Type: Boolean
Whether to log the resolved dependencies (defaults to false
).
Type: Boolean
Whether to just continue instead of emitting an error if circular dependencies are detected (defaults to false
).
FAQs
Resolve dependency directives in assets (e.g. "@requires" or "//= require" in JavaScript)
The npm package gulp-dependency-directive receives a total of 64 weekly downloads. As such, gulp-dependency-directive popularity was classified as not popular.
We found that gulp-dependency-directive 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.