gulp-includer
v0.1.0
Published
A plugin for Gulp
Downloads
5
Readme
gulp-includer
Concatenate JavaScript files with Includer as a gulp plugin.
Usage
First, install gulp-includer
as a development dependency:
npm install --save-dev gulp-includer
Then, add it to your gulpfile.js
:
var includer = require("gulp-includer");
gulp.src("./js/app.js", { read:false })
.pipe(includer(options))
.pipe(gulp.dest("./dist"));
API
includer(options)
These options are passed directly to Includer's options argument.
options.separator
Type: String
Default: \n
The string to use to join files together.
options.wrap
Type: Function
Default: function (src) { return '(function(){' + src + '})()'; }
A function to optionally wrap each file in a closure.
options.debug
Type: Boolean|Function
Default: false
Sometimes included globs have no matches. Includer will skip these globs silently.
If the debug
option is true, a notification will be logged to the console when globs have no matches.
If the debug
option is a function, it will be called with the debug message as the only parameter.
includer({
debug : function (message) {
logs.push(message);
}
});