A Rollup plugin that automatically externalizes dependencies and peerDependencies listed in package.json, keeping them out of the bundle for library development. Version 2.0.0 (latest) supports Rollup ≥0.45.2 and Node ≥6. Key differentiator: automatically parses dependencies, peerDependencies, and optionalDependencies from package.json, unlike manual external configuration or other plugins that require explicit lists. Simple to set up with zero configuration for most cases.
npm install rollup-plugin-auto-externalVerified import paths — ran on the pinned version, not inferred.
Shows minimal Rollup config using autoExternal to exclude all package.json dependencies from the bundle.
Place autoExternal as the first plugin in the plugins array.
Manually externalize dependencies from workspace packages or use a monorepo-aware plugin.
Ensure package.json contains the relevant dependency fields, or manually configure external.
Upgrade Rollup to >=0.45.2.
Use autoExternal() instead of 'auto-external' in plugins array.
Use `import autoExternal from 'rollup-plugin-auto-external'`.
Manually add a `globals` config for external dependencies or use output.format 'cjs'/'es'.