rollup-load-plugins
Loads Rollup plugins listed in package.json.
Last updated 4 years ago by timdp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-load-plugins 
SYNC missed versions from official npm registry.

rollup-load-plugins

npm Dependencies Build Status Coverage Status JavaScript Standard Style

Loads Rollup plugins listed in package.json. Like gulp-load-plugins, but for Rollup.

Installation

npm install --save-dev rollup-load-plugins

Usage

import loadPlugins from 'rollup-load-plugins'
import { rollup } from 'rollup'

const plugins = loadPlugins()

// Then, if you have rollup-plugin-node-resolve and rollup-plugin-commonjs ...
rollup({
  plugins: [
    plugins.nodeResolve({ jsnext: true, main: true }),
    plugins.commonjs({ include: 'node_modules/**' })
  ]
})

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

Tim De Pauw

License

MIT

Current Tags

  • 0.4.0                                ...           latest (2 years ago)

5 Versions

  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 5
This Month 5
Last Day 0
Last Week 0
Last Month 7
Dependencies (6)
Dev Dependencies (22)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |