Registry / devops / rollup-load-plugins

rollup-load-plugins

JSON →
library0.4.0jsnpmunverified

Utility to automatically load Rollup plugins listed in package.json, similar to gulp-load-plugins. Version 0.4.0 is the latest stable release, with slow development cadence. It reads dependencies, devDependencies, and peerDependencies matching a configurable pattern (default: rollup-plugin-*) and exposes them as camelCased properties on an object. Supports scoped packages, custom patterns, and configurable replacement strings. Unlike manual imports, it reduces boilerplate and enables dynamic plugin loading. No security incidents reported.

npm install rollup-load-plugins
INSTALL
IMPORT
SIG · ROLLUP-LOAD-PLUGIN
R
rollup-load-plugins
devopsjavascriptv0.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

loadPlugins
import loadPlugins from 'rollup-load-plugins'
const loadPlugins = require('rollup-load-plugins')
Package is ESM-only; CommonJS require may fail depending on Node version and module settings.
default import
import loadPlugins from 'rollup-load-plugins'
import { loadPlugins } from 'rollup-load-plugins'
The package exports a single function as default export, not a named export.
plugins object usage
const plugins = loadPlugins(); plugins.rollupPluginSomething(...)
Properties are camelCased by default; e.g., 'rollup-plugin-node-resolve' becomes 'plugins.nodeResolve'.

Loads all rollup-plugin-* packages from package.json and uses them in a Rollup build.

import loadPlugins from 'rollup-load-plugins'; import { rollup } from 'rollup'; const plugins = loadPlugins(); async function build() { const bundle = await rollup({ input: 'src/index.js', plugins: [ plugins.nodeResolve({ jsnext: true, main: true }), plugins.commonjs({ include: 'node_modules/**' }) ] }); await bundle.write({ file: 'dist/bundle.js', format: 'cjs' }); } build().catch(console.error);
Debug
Known issues
gotchaPlugin names are camelCased by default; e.g., rollup-plugin-node-resolve becomes plugins.nodeResolve.
fix
Use camelCase property names when accessing plugins.
affects: >=0.1.0
gotchaScoped packages like @mycompany/rollup-plugin-foo become plugins.mycompany.foo by default if maintainScope is true.
fix
Set maintainScope to false if you prefer plugins.foo.
affects: >=0.1.0
gotchaOnly plugins matching the pattern (default: rollup-plugin-*) are loaded. Other dependencies are ignored.
fix
Verify your plugin names match the pattern or adjust the pattern option.
affects: >=0.1.0
gotchaPlugins are required at load time, not lazily. All matching packages are imported immediately.
fix
Ensure all matching packages are valid Rollup plugins to avoid runtime errors.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'rollup-plugin-*'
The plugin is not installed or not listed in package.json under dependencies/devDependencies/peerDependencies.
fix
Install the missing plugin: npm install --save-dev rollup-plugin-<name>
TypeError: plugins.nodeResolve is not a function
CamelCase transformation may produce unexpected property names or the plugin was not loaded.
fix
Check the exact property name by logging plugins or verifying pattern and replaceString options.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources
rollup-load-plugins — npm install rollup-load-plugins · libregistry