
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
gulp-inheritance
Advanced tools
A gulp plugin for dependency-resolution. There are several options out there, but none of those that I found were a good fit for my gulp setup. Some work like grunt plugins (i.e. they actually work on the file system), others have distinctly different use-cases.
gulp-inheritance
does only a few things, and leaves everything else up to you:
npm install gulp-inheritance --save-dev
Simple example:
gulp.src('src/styles/**/*.scss')
.pipe(gulpInheritance({extract: /@import '(.+)';/g}))
.pipe(process()) // whatever you want to do with the files
.pipe(gulp.dest('dev'))
Complex example:
gulp.src('src/styles/**/*.scss')
.pipe(preProcess())
.pipe(gulpInheritance({
includeAll: true,
extract: /@import '(.+)';/mg
normalizePath: customNormalization,
originalPaths: true
}))
.pipe(sass())
.pipe(postProcess())
.pipe(gulp.dest('dev'))
The two examples above show the plugin's minimum and maximum supported setup. It should be clear, on account of that simplicity, that you can use the plugin for any file format.
The examples apply to SCSS files, but that's just for illustration.
gulp-inheritance
is intentionally devoid of language-specific knowledge
in order to keep it lean. You can, of course,
easily create derivative plugins that contain said knowledge.
This can be either a regular expression (or string) matching the pattern of dependency declaration used, or a function.
m
flag. Also, do not forget the g
flag. The first matching group will be used as dependency path – either relative to the depending file's own path, or absolute.You can give a function for custom path normalization here. E.g. with SCSS imports, you'll want to remove the underscore from partials in order for them to be properly identified.
Applies to both incoming files and their dependencies.
This is useful if you perform any transformations on your files' paths prior to applying this plugin.
ISC
FAQs
Gulp plugin to emit the files that depend on the input files
The npm package gulp-inheritance receives a total of 3 weekly downloads. As such, gulp-inheritance popularity was classified as not popular.
We found that gulp-inheritance 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
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.