{"id":21986,"library":"rollup-plugin-deps-external","title":"rollup-plugin-deps-external","description":"Rollup plugin (v0.2.1) that automatically externalizes dependencies listed in package.json (dependencies, peerDependencies, and Node.js builtins). It simplifies the common task of excluding npm packages from the bundle, reducing bundle size and avoiding duplication. Most code is borrowed from rollup-plugin-auto-external but offers a slightly different API. Its defaults externalize builtins, dependencies, and peerDependencies. The last release was 0.2.0 with 0.2.1 as a patch. No known security issues. It integrates seamlessly with an existing Rollup external function.","status":"active","version":"0.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/leonzalion/rollup-plugin-deps-external","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-deps-external","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-deps-external","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-deps-external","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is ESM-only. CommonJS require will fail.","wrong":"const depsExternal = require('rollup-plugin-deps-external')","symbol":"depsExternal","correct":"import depsExternal from 'rollup-plugin-deps-external'"},{"note":"The module uses a default export, not a named export. Named import will not work.","wrong":"import depsExternal from 'rollup-plugin-deps-external'","symbol":"depsExternal","correct":"import { depsExternal } from 'rollup-plugin-deps-external'"},{"note":"Default import is correct. No named exports available.","wrong":"","symbol":"depsExternal","correct":"import depsExternal from 'rollup-plugin-deps-external'"}],"quickstart":{"code":"// rollup.config.js\nimport depsExternal from 'rollup-plugin-deps-external';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'es'\n  },\n  plugins: [\n    depsExternal()\n  ]\n};","lang":"javascript","description":"Minimal Rollup config that automatically externalizes all dependencies, peerDependencies, and Node builtins."},"warnings":[{"fix":"Ensure your project is ESM (\"type\": \"module\" in package.json) or use a dynamic import.","message":"The package is ESM-only and cannot be used with CommonJS require.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Use: import depsExternal from 'rollup-plugin-deps-external'","message":"The plugin uses a default export. Attempting named import will result in undefined.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Pass options object, e.g., depsExternal({ peerDependencies: false }).","message":"Options like builtins, dependencies, peerDependencies default to true. If you want to exclude some, you must explicitly set them to false.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Set packagePath: path.resolve('./path/to/package.json').","message":"The packagePath defaults to process.cwd(). If your package.json is elsewhere, you must provide the correct path.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Convert your config to ESM (use .mjs or \"type\": \"module\" in package.json) and use import.","cause":"Using CommonJS require to load an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."},{"fix":"Change import statement to: import depsExternal from 'rollup-plugin-deps-external'","cause":"Named import ({ depsExternal }) instead of default import.","error":"TypeError: (0 , _rollupPluginDepsExternal.default) is not a function"},{"fix":"Add the package to dependencies or peerDependencies, or use a different externalization strategy.","cause":"The package is not in package.json (e.g., a devDependency) but the plugin does not externalize it.","error":"Could not resolve import: some-package (imported by src/index.js)."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}