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-bundleVerified import paths — ran on the pinned version, not inferred.
Automatically externalize 'dependencies' and 'peerDependencies' from the Rollup bundle, avoiding bundling of external packages.
Upgrade Rollup to v4 or migrate to a different plugin for Rollup v3.
Set 'dependencies' and 'peerDependencies' to true/false.
Manually add other categories to 'external' config if needed.
npm install --save-dev rollup-plugin-exclude-dependencies-from-bundle
Use import (ESM) or const plugin = require('rollup-plugin-exclude-dependencies-from-bundle').default;Call excludeDependenciesFromBundle({ peerDependencies: true })