{"id":22159,"library":"rollup-plugin-peer-deps-external","title":"rollup-plugin-peer-deps-external","description":"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.","status":"maintenance","version":"2.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/pmowrer/rollup-plugin-peer-deps-external","tags":["javascript","rollup","plugin","rollup-plugin","peerDependencies","external","optimize","exclude"],"install":[{"cmd":"npm install rollup-plugin-peer-deps-external","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-peer-deps-external","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-peer-deps-external","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires Rollup to function as a plugin.","package":"rollup","optional":false}],"imports":[{"note":"Default export via ESM. CJS require works (package exports both) but ESM is preferred in modern bundles.","wrong":"const peerDepsExternal = require('rollup-plugin-peer-deps-external')","symbol":"peerDepsExternal","correct":"import peerDepsExternal from 'rollup-plugin-peer-deps-external'"}],"quickstart":{"code":"// rollup.config.js\nimport peerDepsExternal from 'rollup-plugin-peer-deps-external';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'esm'\n  },\n  plugins: [\n    // Should be placed first to ensure peer deps are external before other plugins process them\n    peerDepsExternal()\n  ]\n};","lang":"javascript","description":"Basic Rollup configuration using the plugin to automatically externalize peer dependencies from package.json."},"warnings":[{"fix":"Avoid using `includeDependencies`; manually externalize dependencies if needed.","message":"The `includeDependencies` option is deprecated and may be removed in future.","severity":"deprecated","affected_versions":">=2.2.0 <3.0.0"},{"fix":"If you relied on only top-level packages being externalized, update your imports or use a custom external function.","message":"v2.0.0 changed behavior to also externalize module paths (e.g., 'lodash/map') in addition to top-level packages.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Place `peerDepsExternal()` as the first plugin in the `plugins` array.","message":"Plugin must run early in plugin list to externalize peer deps before other plugins (e.g., commonjs) resolve them.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Either use the plugin alone or manually merge external patterns by reading peerDependencies yourself.","message":"Does not handle custom `external` config; if you set both, the plugin may override or conflict.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2.2.0':97 '2.2.4':17 '2020':21 'approach':58 'automat':7 'base':57 'bundl':12,77 'cadenc':90 'compar':48 'config':36,65 'current':13 'dep':5 'depend':32,82,88 'e.g':40 'elimin':27 'enumer':29 'exclud':107 'extern':6,8,35,52,105 'featur':95 'flag':47 'includ':43 'includedepend':46 'javascript':98 'last':18 'librari':76 'list':51 'lodash/map':41 'low':92 'mainten':24 'manual':28,50 'minim':81 'modul':38 'new':94 'octob':20 'optim':106 'option':45 'package.json':70 'path':39 'pattern':56 'pattern-bas':55 'peer':4,31,87 'peerdepend':9,104 'plugin':3,60,100,103 'provid':61 'read':68 'releas':19,89 'rollup':2,11,84,99,102 'rollup-plugin':101 'rollup-plugin-peer-deps-extern':1 'sinc':96 'solut':66 'stabl':14 'status':25 'support':37 'use':54,74 'version':15 'wide':73 'workflow':78 'zero':64 'zero-config':63","created_at":"2026-04-27T17:03:41.925210+00:00","updated_at":"2026-04-27T17:03:41.925210+00:00","problems":[{"fix":"npm install --save-dev rollup-plugin-peer-deps-external","cause":"Package not installed or missing from dependencies.","error":"Error: Cannot find module 'rollup-plugin-peer-deps-external'"},{"fix":"Use `import peerDepsExternal from 'rollup-plugin-peer-deps-external'` (default import).","cause":"Importing incorrectly (e.g., named import instead of default import).","error":"TypeError: peerDepsExternal is not a function"},{"fix":"Remove `includeDependencies` from plugin options.","cause":"Using deprecated `includeDependencies` option.","error":"(!) Plugin peerDepsExternal: Options includeDependencies is deprecated"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/pmowrer/rollup-plugin-peer-deps-external","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-peer-deps-external","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}