Automatically externalizes peerDependencies in Rollup bundles. Current stable version is 2.2.4 (last released October 2020), with a maintenance status. It eliminates manual enumeration of peer dependencies in the `external` config, supports module paths (e.g., `lodash/map`), and includes an optional `includeDependencies` flag. Compared to manually listing externals or using pattern-based approaches, this plugin provides a zero-config solution that reads from package.json. It is widely used in library bundling workflows and has minimal dependencies (only `rollup` as a peer dependency). Release cadence is low; no new features since 2.2.0.
npm install rollup-plugin-peer-deps-externalVerified import paths — ran on the pinned version, not inferred.
Basic Rollup configuration using the plugin to automatically externalize peer dependencies from package.json.
Avoid using `includeDependencies`; manually externalize dependencies if needed.
If you relied on only top-level packages being externalized, update your imports or use a custom external function.
Place `peerDepsExternal()` as the first plugin in the `plugins` array.
Either use the plugin alone or manually merge external patterns by reading peerDependencies yourself.
npm install --save-dev rollup-plugin-peer-deps-external
Use `import peerDepsExternal from 'rollup-plugin-peer-deps-external'` (default import).
Remove `includeDependencies` from plugin options.