Skip to content

rollup-plugin-add-bannerAdd Banner to Your Bundle

A Rollup plugin that adds banner comments to the output bundle

rollup-plugin-add-banner

Quick Start

Install

bash
# pnpm
pnpm add -D rollup-plugin-add-banner

# npm
npm install -D rollup-plugin-add-banner

Usage

js
import addBanner from 'rollup-plugin-add-banner'

export default {
  input: 'src/index.js',
  output: {
    file: 'dist/index.js',
    format: 'es'
  },
  plugins: [
    addBanner({
      content: '/*! ${name} v${version} (c) ${author} */'
    })
  ]
}

Why rollup-plugin-add-banner?

  • Template Variables: Auto-resolve ${name}, ${version}, ${author}, ${license} from package.json
  • Simple API: Just provide the banner content and you're done
  • Works with All Rollup Versions: Compatible with Rollup 2.x, 3.x, and 4.x
  • Multiple Banners: Different banners for different file types
  • Include/Exclude: Fine-grained control with glob patterns
  • 100% Test Coverage: Thoroughly tested for reliability

Released under the MIT License.