gulp-load-plugins is a gulp plugin that can automatically load any gulp plugin mentioned in package.json.
gulp-load-plugins
is a gulp plugin that can automatically load any gulp plugin mentioned in package.json. It can attach loaded gulp plugins to the global scope or to a certain object.
Given that the package.json
file has the following dependencies section:
"dependencies": {
"gulp-filter": "*",
"gulp-imagemin": "*"
}
Adding the following line into gulpfile.js
:
var plugins = require('gulp-load-plugins')();
Is equivalent to:
plugins.filter = require('gulp-filter');
plugins.imagemin = require('gulp-imagemin');
Such an approach saves from manual requiring of each gulp plugin.