Skip to content
PluginStats

vite-plugin-banner weekly downloads statistics

By chengpeiquan · npm · Vite plugins

A banner plugin for Vite. Adds a banner to the top of each generated chunk.

View on npm Fresh · Dec 6, 2026

vite-plugin-banner has 44,534 recorded weekly downloads on npm, an increase of 2.5% over the past 30 days, ranking #817 of 3,247 tracked listings.

Weekly downloads
44,534
Official API · Dec 5, 2026
7-day growth
+15.0%
+5.8K weekly downloads
30-day growth
+2.5%
+1.1K weekly downloads
90-day growth
+182%
+28.8K weekly downloads
Rank
#817
▲ 3 in 7 days

About vite-plugin-banner

<p align='center'> <img src="https://cdn.jsdelivr.net/gh/chengpeiquan/assets-storage/img/2021/02/20210224005014.png" alt="vite-plugin-banner" /> </p> <p align='center'> <a href='https://www.npmjs.com/package/vite-plugin-banner'> <img src="https://img.shields.io/npm/v/vite-plugin-banner?color=56b7ff&label=npm" /> </a> <a href="https://www.npmjs.com/package/vite-plugin-banner" target="__blank"> <img src="https://img.shields.io/npm/dt/vite-plugin-banner?color=56b7ff&label=" /> </a> <a href="https://github.com/chengpeiquan/vite-plugin-banner/blob/main/README.md" target="__blank"> <img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20demos&color=56b7ff" /> </a> <a href="https://github.com/chengpeiquan/vite-plugin-banner" target="__blank"> <img alt="GitHub stars" src="https://img.shields.io/github/stars/chengpeiquan/vite-plugin-banner?style=social" /> </a> </p> <br> <br>

English | 简体中文

Features

Adds a banner to the top of each generated chunk.

Installation

Install the package from npm (or yarn, or pnpm).

npm install -D vite-plugin-banner

Options

Plugin Options TypeDescriptionExample
stringThe banner contentBasic usage
ContentCallbackSee the type declarations belowAdd different banners
BannerPluginOptionsSee the type declarations belowOptional parameter format

· Type Declarations:

/**
 * Some options from `vite.config.[ts|js]`
 * @since 0.2.0
 */
export interface BannerPluginOptions {
  /**
   * The comment content of the banner
   *
   * @since ^0.6.0 support for `ContentCallback` types
   */
  content: string | ContentCallback

  /**
   * The output directory from the configuration of Vite.js
   *
   * @see https://vitejs.dev/config/build-options.html#build-outdir
   *
   * @default viteConfig.build.outDir
   */
  outDir?: string

  /**
   * Whether to print error messages to the console
   *
   * @since 0.4.0
   *
   * @default false
   */
  debug?: boolean

  /**
   * By default, the validity of the content will be verified.
   *
   * If set to `false`, no verification will be performed.
   *
   * @see https://github.com/chengpeiquan/vite-plugin-banner/issues/13
   *
   * @since 0.5.0
   *
   * @default true
   */
  verify?: boolean
}

/**
 * Callback function to get the contents to be injected.(or not inject)
 *
 * @since 0.6.0
 *
 * @param fileName - The name of the file currently being processed
 *
 * @returns
 *  1. When a valid string is returned, it will become the banner content
 *  2. Returning a Falsy value will skip processing(e.g. `''`, `null`, `undefined`)
 *
 * @example
 *
 * ```ts
 *  content: (fileName: string) => {
 *    // Or use switch statement
 *    return fileName.endsWith('.js')
 *      ? 'This message will inject into `js` files.'
 *      : 'This message will inject into other files.'
 *  }
 * ```
 */
export type ContentCallback = (fileName: string) => string | null | undefined

Usage

In most cases, just use the string format as a plugin option.

Basic usage

Add it to vite.config.ts

// vite.config.ts
import banner from 'vite-plugin-banner'
// Other dependencies...

export default defineConfig({
  plugins: [banner('This is the banner content.')],
})

When you run npm run build on your project, In the dist folder(Or the build.outDir in vite.config.ts you configured), Except for vendor files, all js and css files will add a banner to the top.

e.g. in app.b3a7772e.js:

/* This is the banner content. */
var e=Object.assign;import{M as t,d as a,u as r,c......
Advanced usage

Of course, the most ideal banner is related to your package information.

First, You need to update your package.json like this, For example, it contains such field content:

{
  "name": "chengpeiquan.com",
  "version": "0.1.0",
  "description": "My personal website, technology stack based on Vue.js 3.0, and Vite 2.0, use Server Side Generation.",
  "author": "chengpeiquan",
  "homepage": "https://chengpeiquan.com/"
}

Then, import the package.json into vite.config.ts, update the banner like this:

// vite.config.ts
import pkg from './package.json'
// Other dependencies...

export default defineConfig({
  plugins: [
    banner(
      `/**\n * name: ${pkg.name}\n * version: v${pkg.version}\n * description: ${pkg.description}\n * author: ${pkg.author}\n * homepage: ${pkg.homepage}\n */`,
    ),
  ],
})

Run npm run build, you can see the banner become more detailed.

e.g. in app.6936be52.js:

/**
 * name: chengpeiquan.com
 * version: v0.1.0
 * description: My personal website, technology stack based on Vue.js 3.0, and Vite 2.0, use Server Side Generation.
 * author: chengpeiquan
 * homepage: https://chengpeiquan.com/
 */
var e=Object.assign;import{M as t,d as a,u as r,c......
Fun usage

If you want to make some banners that show your personality, you can make some interesting content from some online generators.

Such as:

Description from the npm listing.

  • vite-plugin
  • vite plugin
  • vite banner

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-banner weekly downloads on npm, last 90 days: 44,534 weekly downloads as of Dec 5, 2026, +182% over 90 days.vite-plugin-bannerWeekly downloads on npm · Last 90 days44,534downloads / week+182% over 90 days010K20K30K40K50K60KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-banner weekly downloads on npm, last 90 days: 44,534 weekly downloads as of Dec 5, 2026, +182% over 90 days.

7/30/90-day growth

vite-plugin-banner weekly downloads growth on npm: +15.0% over 7 days, +2.5% over 30 days, +182% over 90 days.vite-plugin-bannerWeekly downloads growth on npm44,534downloads / week now7-day growth+5,799 weekly downloads+15.0%30-day growth+1,087 weekly downloads+2.5%90-day growth+28,760 weekly downloads+182%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-banner weekly downloads growth on npm: +15.0% over 7 days, +2.5% over 30 days, +182% over 90 days.

Ranking history

vite-plugin-banner npm ranking history: currently #817 (by weekly downloads).vite-plugin-bannernpm ranking · by weekly downloads · Last 90 days#817current rank#300#400#500#600#700#800#900Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-banner npm ranking history: currently #817 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 41, #17 (overall #817)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 8, #2 (overall #142)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (591)
Recent weekly downloads observations for vite-plugin-banner
Date (UTC)Weekly downloadsChange vs. previous
44,534+528
44,006+2.7K
41,309+3.7K
37,639+3.4K
34,190+623
33,567-5.1K
38,715-20
38,735+261
38,474-3.2K
41,674-2.5K
44,191-3.8K
48,011-1.4K
49,448-1.2K
50,653—

Similar npm Vite plugins plugins

All 20 vite-plugin-banner alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-banner. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.