Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
gulp-dependencies-changed
Advanced tools
Readme
Smart incremental building by dependency analysis.
npm install --save-dev gulp-dependencies-changed
var less = require('gulp-less');
var changed = require('gulp-dependencies-changed');
var Path = require('path');
var rename = require('rename');
gulp.task('less', function() {
return gulp.src('./less/**/*.less')
// Analyze dependencies for less. Pass through
// only files that its depending files are changed.
.pipe(changed({
matcher: /@import ['"]?([^'"]+)['"]?;/g,
dest: function(srcRelPath, srcBasePath) {
// It should return dest file path.
return rename(srcPath, function(fileObj) {
return {
dirname: Path.join('public/css' + fileObj.dirname)
extname: 'css',
};
});
},
}))
.pipe(less())
.pipe(gulp.dest('./public/css'));
});
Only pass through dependent files that depending to changed files
Type: RegExp
This RegExp MUST include only a capturing group and SHOULD be global match.
The result of the match will be given to a pathResolver
.
Type: function(string, string): string
This function take an argument (a relative file path and the base path).
The source file path is exactly equivalent to path.relative(vinylFile.path, vinylFile.base)
.
It SHOULD return the file path for the dest file path.
The return value is used as a target of comparison.
You can easily rename by using rename.
Type: function(string, string): string
Default: changed.relativeResolver
This function take 2 arguments (a dependent file path, the depended file path captured by matcher
) and MUST return a file path for the depending file.
If omitted, it takes a related file path from the dependent file.
If file extensions is omitted, you can complement the file extensions by the function.
Type: function(VinylFile, VinylFile): boolean
Default: changed.compareByMtime
This function take 2 arguments (a depending file and the dependent file) and it MUST return true
when the depending is newer than the dependent file.
If omitted, it compare by the both mtime.
Type: boolean
Default: false
Print debug messages when it is truthy.
MIT
FAQs
Smart incremental building by dependency analysis
The npm package gulp-dependencies-changed receives a total of 1,080 weekly downloads. As such, gulp-dependencies-changed popularity was classified as popular.
We found that gulp-dependencies-changed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.