Registry / devops / rollup-plugin-exclude-dependencies-from-bundle

rollup-plugin-exclude-dependencies-from-bundle

JSON →
library1.1.24jsnpmunverified

A Rollup plugin that automatically externalizes a library's dependencies and peerDependencies from the bundle output. Version 1.1.24 is stable, with frequent releases following semantic versioning. It eliminates the need to manually maintain the `external` config for library projects, supporting both ESM and CJS output. Compared to alternatives like `rollup-plugin-auto-external`, this plugin offers simpler configuration with boolean flags for `dependencies` and `peerDependencies`. Ships TypeScript declarations and supports Rollup v4+.

npm install rollup-plugin-exclude-dependencies-from-bundle
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-EXCL
R
rollup-plugin-exclude-dependencies-from-bundle
devopsjavascriptv1.1.24
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

excludeDependenciesFromBundle
✓ import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle'
✗ const excludeDependenciesFromBundle = require('rollup-plugin-exclude-dependencies-from-bundle')
Default export; ESM-only since v1.1.0. Requires Rollup >=4.
ExcludeDependenciesFromBundleOptions
✓ import type { ExcludeDependenciesFromBundleOptions } from 'rollup-plugin-exclude-dependencies-from-bundle'
✗ import { ExcludeDependenciesFromBundleOptions } from 'rollup-plugin-exclude-dependencies-from-bundle'
Type-only import for TypeScript usage. Not a runtime value.

Automatically externalize 'dependencies' and 'peerDependencies' from the Rollup bundle, avoiding bundling of external packages.

// rollup.config.mjs import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle'; export default { input: 'src/index.ts', output: { file: 'dist/index.js', format: 'es' }, plugins: [ excludeDependenciesFromBundle({ peerDependencies: true, dependencies: true }) ] };
Debug
Known issues
breakingPlugin requires Rollup v4 or later. No support for Rollup v3.
fix
Upgrade Rollup to v4 or migrate to a different plugin for Rollup v3.
affects: <1.1.0 || ?
deprecatedOptions 'include' and 'exclude' were removed in v1.1.0; use boolean flags only.
fix
Set 'dependencies' and 'peerDependencies' to true/false.
affects: >=1.1.0
gotchaDoes not handle 'optionalDependencies' or 'bundledDependencies'. Only 'dependencies' and 'peerDependencies'.
fix
Manually add other categories to 'external' config if needed.
affects: all
Errors
Common errors & fixes
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'rollup-plugin-exclude-dependencies-from-bundle'
Missing installation or incorrect Node.js ESM resolution.
fix
npm install --save-dev rollup-plugin-exclude-dependencies-from-bundle
TypeError: excludeDependenciesFromBundle is not a function
Default import in ESM vs CJS require mismatch.
fix
Use import (ESM) or const plugin = require('rollup-plugin-exclude-dependencies-from-bundle').default;
'peerDependencies' is not defined in rollup.config.js
Forgetting to pass options object; passing undefined or missing property.
fix
Call excludeDependenciesFromBundle({ peerDependencies: true })
Upgrade
Version history
1.1.24latest on npm
Audit
Dependencies
rolluprequiredPeer dependency required for integration as a plugin.
Agent activity
9 hits · last 30 days
node
8
Resources
rollup-plugin-exclude-dependencies-from-bundle — npm install rollup-plugin-exclude-dependencies-from-bundle · libregistry