rollup-load-plugins
Loads Rollup plugins listed in package.json. Like gulp-load-plugins, but for Rollup.
Installation
npm install --save-dev rollup-load-plugins
Usage
const plugins = // Then, if you have rollup-plugin-node-resolve and rollup-plugin-commonjs ...
Options
This is a subset of gulp-load-plugins's options. The behavior should be identical.
pattern
The glob(s) against which to match package names.
Default: ['rollup-plugin-*']
scope
The keys from package.json
in which to discover plugins.
Default: ['dependencies', 'devDependencies', 'peerDependencies']
replaceString
The string or regexp to replace in the plugin name.
Default: /^rollup-plugin-/
camelize
Transform hyphenated plugin names to camelCase.
Default: true
cwd
The path to the package depending on the plugin. This option does not exist in gulp-load-plugins.
Default: process.cwd()
maintainScope
Treat package scopes as intermediary objects. With this option set to true
,
@mycompany/rollup-plugin-myplugin
will be available as
plugins.mycompany.myplugin
. Setting it to false
will create
plugins.myplugin
, which can create naming collisions.
Default: true
TODO
gulp-load-plugins contains a few more useful options that this package does not implement. Pull requests that implement those are appreciated.
Author
License
MIT