
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-custom-include
Advanced tools
Gulp plugin for including files
The include plugin searches the provided file for a standardized format and if found, gets the content of the provided file and injects into the original at that location.
Install package with NPM and add it to your development dependencies:
npm install --save-dev gulp-custom-include
Package | gulp-custom-include |
Description | Include files into others using a standardized syntax |
Node Version | >= 0.10 |
var include = require("gulp-custom-include");
gulp.task("scripts", function() {
return gulp
.src("foo.js")
.pipe(include())
.pipe(gulp.dest("./dist/"));
});
foo.js
//@include(bar.js)
Returns a stream with the included content injected into the Vinyl files.
include([opts])
Type: Array
An array of paths to search for the included file.
var include = require("gulp-custom-include");
gulp.task("scripts", function() {
return gulp
.src("./path/*.js")
.pipe(
include({
includes: ["js/includes", "includes"],
}),
)
.pipe(gulp.dest("./dist/"));
});
Type: String
A way to optionally customize the prefix that triggers the include; default is //@
.
var include = require("gulp-custom-include");
gulp.task("scripts", function() {
return gulp
.src("foo.js")
.pipe(
include({
prefix: "//--",
}),
)
.pipe(gulp.dest("./dist/"));
});
foo.js
//--include(bar.js)
Type: String
A way to optionally customize the keyword that triggers the include; default allows for either include
or replace
.
var include = require("gulp-custom-include");
gulp.task("scripts", function() {
return gulp
.src("foo.js")
.pipe(
include({
keyword: "inject",
}),
)
.pipe(gulp.dest("./dist/"));
});
foo.js
//@inject(bar.js)
Type: String
A way to optionally customize the regex which facilitates the capturing of the filename from the include string. This parses everything that appears after the prefix and the keyword. The default is: \\([\\s\'\"]*([a-z\.]*)[\\s\'\"]*\\)
.
var include = require("gulp-custom-include");
gulp.task("scripts", function() {
return gulp
.src("foo.js")
.pipe(
include({
regex: ":[\\s'\"]*([a-z.]*)[\\s'\"]*",
}),
)
.pipe(gulp.dest("./dist/"));
});
foo.js
//@include: bar.js
1.0.0 (2018-08-07)
FAQs
A gulp plugin for including a file's contents into another
The npm package gulp-custom-include receives a total of 3 weekly downloads. As such, gulp-custom-include popularity was classified as not popular.
We found that gulp-custom-include 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
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.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.