{"id":22089,"library":"rollup-plugin-internal","title":"rollup-plugin-internal","description":"Rollup plugin (v1.0.4) that forces specified dependencies to be treated as internal, preventing Rollup from externalizing them. Useful when bundling libraries that re-export certain peer dependencies. Minimal configuration: just pass an array of module names. Works with Rollup >=0.45.2. Alternative to manual external() or other deduplication plugins.","status":"active","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/ashleyw/rollup-plugin-internal","tags":["javascript","dependencies","internal","plugin","rollup"],"install":[{"cmd":"npm install rollup-plugin-internal","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-internal","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-internal","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin integration","package":"rollup","optional":false}],"imports":[{"note":"The package exports a default function; CommonJS require works as well but TypeScript may need esModuleInterop for default import.","wrong":"const internal = require('rollup-plugin-internal')","symbol":"default import","correct":"import internal from 'rollup-plugin-internal'"},{"note":"There is no named export 'internal'; always use default import.","wrong":"import { internal } from 'rollup-plugin-internal'","symbol":"Named import (incorrect)","correct":"import internal from 'rollup-plugin-internal'"}],"quickstart":{"code":"// rollup.config.js\nimport internal from 'rollup-plugin-internal';\n\nexport default {\n  input: 'src/index.js',\n  output: { file: 'dist/bundle.js', format: 'es' },\n  plugins: [\n    internal(['lodash', 'moment'])\n  ]\n};","lang":"javascript","description":"Shows basic usage: import the plugin, pass an array of module names to keep internal."},"warnings":[{"fix":"Always place internal() as the final plugin in the rollup config plugins array.","message":"The plugin must be listed last in the plugins array to ensure it correctly overrides externalization done by other plugins.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure modules are resolvable by your bundle (e.g., use rollup-plugin-node-resolve).","message":"Specified modules are marked as internal but not bundled automatically; other plugins (like node-resolve) must still resolve them.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider migrating to Rollup's built-in 'output.inlineDynamicImports' or custom resolveId hooks.","message":"The package has not been updated since 2018 and may not work with newer Rollup versions (>2.x) due to plugin API changes.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-plugin-internal --save-dev' or 'yarn add -D rollup-plugin-internal'.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-internal'"},{"fix":"Change to 'import internal from 'rollup-plugin-internal''.","cause":"Using named import { internal } instead of default import.","error":"TypeError: Object(...) is not a function"},{"fix":"Provide an array with at least one module name, e.g., internal(['react']).","cause":"Passed empty array or no arguments to the plugin.","error":"(!) Plugin internal: Specified modules are empty array (nothing to mark internal)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}