jackfranklin / gulp-load-plugins

Automatically load in gulp plugins
https://github.com/jackfranklin/gulp-load-plugins
MIT License
757 stars 55 forks source link

When using the gulp.connect plugin, only lazy=false works #25

Closed leomwa closed 10 years ago

leomwa commented 10 years ago

tasks/connect.js

var gulp = require('gulp');
var plugins = require("gulp-load-plugins")({
    lazy: false
});

gulp.task('connect', plugins.connect.server({
    root: ['build'],
    port: 9000,
    livereload: true,
    open: true
}));

Omitting lazy:false and running gulp connect causes the error:

% gulp connect

/gulp/tasks/connect.js:4
gulp.task('connect', plugins.connect.server({
                                     ^
TypeError: Object function () {
        var fn = finalObject[requireName] = require(name);
        return fn.apply(this, arguments);
      } has no method 'server'
leomwa commented 10 years ago

False alarm! Just read that v 0.5 fixed this issue and then checked my dev dependencies. Found out that for some reason version 0.4.0 was npm installed locally o_O