Listing gulp-load-plugins loaded

266 views Asked by At

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 working:

  1. Set lazy loading to false
  2. add console.log(plugins); after the runnung task

    var plugins = require('gulp-load-plugins')({lazy:false});
    ...
    gulp.task('default', ['styles']);
    console.log(plugins);

1

There are 1 answers

0
jlguenego On

In the code of the plugins, you can see that the properties of the object returned are defined with

Object.defineProperty()

And this method allow to set not enumerable properties. So the properties you are looking for don't appear.

I agree that this is "bizarre" as it would help the developper to trace which plugin are actually available.