{"id":22233,"library":"rollup-plugin-strip-banner","title":"rollup-plugin-strip-banner","description":"Rollup plugin to remove banner comments (e.g., license headers) from module files before bundling. Current stable version is 3.1.0, released with support for Rollup 4.x. Released irregularly, with major version bumps aligning with Rollup peer dependency updates. Key differentiator: lightweight, focused solely on banner stripping without additional transforms. Alternatives like rollup-plugin-terser or manual regex require more configuration. Ships TypeScript types.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/mjeanroy/rollup-plugin-strip-banner","tags":["javascript","rollup","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-strip-banner","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-strip-banner","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-strip-banner","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency – the plugin is designed to work as a Rollup plugin and expects Rollup to be installed.","package":"rollup","optional":false}],"imports":[{"note":"Default export; named import causes undefined. ESM since v3 (supports ESM/CJS).","wrong":"import { stripBanner } from 'rollup-plugin-strip-banner'","symbol":"stripBanner","correct":"import stripBanner from 'rollup-plugin-strip-banner'"},{"note":"CJS require returns the default export as a function; destructuring fails.","wrong":"const { stripBanner } = require('rollup-plugin-strip-banner')","symbol":"stripBanner (CommonJS)","correct":"const stripBanner = require('rollup-plugin-strip-banner')"},{"note":"TypeScript types are included; works with ESM imports. For CJS projects, ensure esModuleInterop is enabled.","wrong":null,"symbol":"stripBanner with TypeScript","correct":"import stripBanner from 'rollup-plugin-strip-banner'"}],"quickstart":{"code":"// rollup.config.js\nimport stripBanner from 'rollup-plugin-strip-banner';\nimport { defineConfig } from 'rollup';\n\nexport default defineConfig({\n  input: 'src/index.js',\n  output: {\n    file: 'dist/index.js',\n    format: 'esm'\n  },\n  plugins: [\n    stripBanner({\n      include: '**/*.js',\n      exclude: 'node_modules/**'\n    })\n  ]\n});","lang":"typescript","description":"Configures rollup-plugin-strip-banner in a Rollup config file with include/exclude patterns."},"warnings":[{"fix":"Use rollup-plugin-strip-banner at your own risk or implement a simple plugin that removes banner comments via regex or AST.","message":"rollup-plugin-strip-banner is deprecated; consider using a custom Rollup transform instead.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Upgrade Node to version 14 or later.","message":"Version 3.0.0 drops support for Node <14.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use Rollup >=2 and Node >=10.","message":"Version 2.0.0 drops support for Node <10 and Rollup <2.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Ensure banners are at the top of the module before you trust stripping; consider verifying output.","message":"The plugin may incorrectly remove banners that are not at the very top of the file (e.g., leading comments after shebang).","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to >=1.0.0 to avoid sourcemap issues.","message":"Version 1.0.0 includes a fix for sourcemap generation; previous versions may produce faulty sourcemaps.","severity":"breaking","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":"npm install rollup-plugin-strip-banner --save-dev","cause":"Deprecation: the package is not actively maintained and may have been removed from npm or not installed.","error":"Error: Cannot find module 'rollup-plugin-strip-banner'"},{"fix":"Use import stripBanner from 'rollup-plugin-strip-banner' (default import) instead of import { stripBanner } from 'rollup-plugin-strip-banner' (named import).","cause":"Using named import 'stripBanner' instead of default import.","error":"TypeError: stripBanner is not a function"},{"fix":"Ensure include/exclude follow minimatch glob patterns; exclude overrides include. Use absolute or relative paths correctly.","cause":"Misunderstanding of minimatch patterns or order of precedence.","error":"The 'include' and 'exclude' options are not working as expected"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}