Questions tagged [gulp-load-plugins]

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.

15 questions
32
votes
13 answers

events.js:160 throw er; // Unhandled 'error' event

The project I worked on was built with gulp. Recently I updated the node version to v6.3.1. Then something came wrong. A task named 'html' throws an error. Here is the part of error code of it. bogon:toClient work$ gulp html (node:2519) fs:…
Heath Yang
  • 471
  • 1
  • 4
  • 10
5
votes
3 answers

gulp-load-plugins not loading plugins

gulp-load-plugins is not loading any plugins. Can anyone suggest why this might be? Node: v0.12.0 NPM: v2.7.3 My package.json: { "name": "foo", "version": "0.0.1", "dependencies": {}, "devDependencies": { "gulp": "^3.8.11", …
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
5
votes
1 answer

Gulp - gulp-load-plugins not working

Gulpfile.js installed via npm install --save-dev gulp-load-plugins var gulp = require('gulp'); // Require all tasks in gulp/tasks, including subfolders require('require-dir')('./gulp/tasks', { recurse: true }); var $ =…
Dev
  • 987
  • 2
  • 14
  • 32
4
votes
1 answer

How to use gulp-load-plugins with TypeScript?

I found no examples for gulp-load-plugins in TypeScript. Unfortunately, my TypeScript is too poor to understand, what should to do from @type/gulp-load-plugins comments. I tried: import * as _gulpPlugins from 'gulp-load-plugins'; const gulpPlugins:…
Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
4
votes
1 answer

How to use gulp-load-plugins with Browser-Sync?

I'm at a point in my Gulp usage that it's starting to make sense splitting tasks up into separate files. For this, I was hoping to use gulp-load-plugins, but although my task runs, Browser-Sync doesn't appear to fire / do anything. Here's my…
Michael Giovanni Pumo
  • 14,338
  • 18
  • 91
  • 140
2
votes
1 answer

Listing gulp-load-plugins loaded

I'm using the gulp-load-plugins, and I'm trying to print the loaded plugins: console.log(JSON.stringify(plugins)); but it only prints {}. Is there anyway to print the loaded plugins and the names assigned to the plugins. UPDATE: Got it…
1
vote
1 answer

Gulp watch runs only once

I'm trying to finish my gulpfile.js but I'm running into a problem with "gulp watch". When I set my watcher to run, it detects changes and run the assigned task, but only once. The next changes on the files don't trigger the tasks anymore. I don't…
FTM
  • 1,887
  • 17
  • 34
1
vote
2 answers

Gulp not creating JS and CSS files using main-bower-files

I am using Gulp to concatenate/minify all JS/CSS files from the bower folder (using main-bower-files) and src folder respectively. I am using gulp-load-plugins to load the following dependencies from package.json (all of which exist in…
Chad Mueller
  • 77
  • 3
  • 10
1
vote
1 answer

gulp-load-plugins.sourcemaps.init() TypeError: Cannot read property 'init' of undefined

I'm trying to adapt a gulp file to my purposes and I'm running into issues. I only care about one task: gulp.task('js:browser', function () { return mergeStream.apply(null, Object.keys(jsBundles).map(function(key) { …
Ian E McAllister
  • 211
  • 2
  • 11
0
votes
2 answers

gulp task for(... in ...) create correctly?

What am I doing wrong? gulpfile.js 'use strict'; // Modules & Plugins var gulp = require('gulp'); const image = require('gulp-image'); var $ = require('gulp-load-plugins')(); let directories = [ '2006/Art1', '2006/Art2', …
Cem Firat
  • 390
  • 2
  • 21
0
votes
1 answer

How can gulp-load-plugins replace all gulp- to g

Default gulp-load-plugins remove all plugin name gulp- But how can make gulp-load-plugins default replace all plugin name which start with gulp- to g? For example gulp-sass other-gulp-plugin rename to gSass other-gulp-plugin
aboutjquery
  • 838
  • 2
  • 11
  • 22
0
votes
0 answers

Issue with app build using Gulp and gulp-load-plugins

I have an issue with building of my project. I started to use gulp-load-plugins on my project to speedup Gulp. Here is my package.json { "name": "Project", "version": "0.0.1", "description": "Project", "author": "DOBRO GROUP", "scripts":…
wkornilow
  • 53
  • 9
0
votes
1 answer

Can't install gulp-load-plugins on server

I'm trying to install gulp-load-plugins on server, but getting error killed extract:gulp-load-plugins:sill doParallel extract 516 npm -v 4.2.0 node -v 4.7.3 Server : Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz OS: Ubuntu 14.04.5 LTS, Trusty Tahr I…
WhatIsHTML
  • 548
  • 1
  • 7
  • 19
0
votes
1 answer

Gulp load plugins error dep is not defiend

I try to use gulp-load-plugins but I got error . for example I try the following var istanbul = require('gulp-istanbul'); var $ = require('gulp-load-plugins')({lazy: true}); gulp.task('run', function () { return gulp.src(config.files) …
user6171746
0
votes
3 answers

Gulp starter kit with gulp-load-plugins

I have a gulp starter kit for my project, however, I want to use gulp-load-plugins to for devDependencies of package.json file. My file structure is ProjectName Gulp -Tasks -broswerify.js -browserSync.js -jade.js -lint.js …
agriboz
  • 4,724
  • 4
  • 35
  • 49