broccoli-load-plugins
Automatically loads broccoli plugins and attaches them to an object of your choice or the global scope.
Usage
$ npm install broccoli-load-plugins --save-dev
Given a package.json
file that has some dependencies within:
Adding this into your Broccolifile.js
:
var broccoliLoadPlugins = ;var plugins = ;
Or, even shorter:
var plugins = ;
Will result in the following happening:
pluginsstaticCompiler = ;pluginsuglifyJs = ;pluginstemplate = ;
You can then use the plugins just like you would if you'd manually required them, but by referring to them as plugins.name()
, rather than just name()
.
This frees you up from having to manually require each broccoli plugin.
Options
You can pass in an object of options (the shown options are the defaults):
;
Credit
Credit largely goes to @jackfranklin for his gulp-load-plugins module. This module is almost identical, just tweaked slightly to work with Broccoli.