Skip to content
PluginStats

vite-plugin-compression2 weekly downloads statistics

By nonzzz (2 listings) · npm · Vite plugins

a fast vite compression plugin

View on npm Fresh · Dec 6, 2026

vite-plugin-compression2 has 766,427 recorded weekly downloads on npm, an increase of 15.6% over the past 30 days, ranking #321 of 3,247 tracked listings.

Weekly downloads
766,427
Official API · Dec 5, 2026
7-day growth
+10.9%
+75.4K weekly downloads
30-day growth
+15.6%
+103.4K weekly downloads
90-day growth
+68.6%
+311.7K weekly downloads
Rank
#321
Among tracked npm listings

About vite-plugin-compression2

<p align="center"> <img src="https://socialify.git.ci/nonzzz/vite-plugin-compression/image?description=1&font=KoHo&language=1&logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F65625612%3Fs%3D200%26v%3D4&name=1&owner=1&pattern=Solid&theme=Auto" width="640" height="320" /> </p>

codecov Download

Install

$ yarn add vite-plugin-compression2 -D

# or

$ npm install vite-plugin-compression2 -D

# or

$ pnpm add vite-plugin-compression2 -D

Usage

Basic Usage
import { defineConfig } from 'vite'
import { compression } from 'vite-plugin-compression2'

export default defineConfig({
  plugins: [
    // ...your plugins
    compression()
  ]
})
Multiple Algorithms
import { compression, defineAlgorithm } from 'vite-plugin-compression2'

export default defineConfig({
  plugins: [
    compression({
      algorithms: [
        'gzip',
        'brotliCompress',
        defineAlgorithm('deflate', { level: 9 })
      ]
    })
  ]
})
Custom Algorithm Function
import { compression, defineAlgorithm } from 'vite-plugin-compression2'

export default defineConfig({
  plugins: [
    compression({
      algorithms: [
        defineAlgorithm(
          async (buffer, options) => {
            // Your custom compression logic
            return compressedBuffer
          },
          { customOption: true }
        )
      ]
    })
  ]
})
With Tarball
import { compression, tarball } from 'vite-plugin-compression2'

export default defineConfig({
  plugins: [
    compression(),
    // If you want to create a tarball archive, use tarball plugin after compression
    tarball({ dest: './dist/archive' })
  ]
})

Options

Compression Plugin Options
paramstypedefaultdescription
includestring | RegExp | Array<string | RegExp>/\.(html|xml|css|json|js|mjs|svg|yaml|yml|toml)$/Include all assets matching any of these conditions.
excludestring | RegExp | Array<string | RegExp>-Exclude all assets matching any of these conditions.
thresholdnumber0Only assets bigger than this size are processed (in bytes)
algorithmsAlgorithms['gzip', 'brotliCompress']Array of compression algorithms or defineAlgorithm results
filenamestring | function[path][base].gz or [path][base]. br If algorithm is zstandard be [path][base].zstThe target asset filename pattern
deleteOriginalAssetsbooleanfalseWhether to delete the original assets or not
skipIfLargerOrEqualbooleantrueWhether to skip the compression if the result is larger than or equal to the original file
logLevelstringinfoControl sdout info
artifactsfunctionundefinedSometimes you need to copy something to the final output. This option may help you.
schedulerSchedulerOptionsundefinedLimit concurrency
Tarball Plugin Options
paramstypedefaultdescription
deststring-Destination directory for tarball

API

defineAlgorithm(algorithm, options?)

Define a compression algorithm with options.

Parameters:

  • algorithm: Algorithm name ('gzip' | 'brotliCompress' | 'deflate' | 'deflateRaw' | 'zstandard' | 'gz' | 'br' | 'brotli' | 'zstd') or custom function
  • options: Compression options for the algorithm

Returns: [algorithm, options] tuple

Examples:

// Built-in algorithm with default options
defineAlgorithm('gzip')

// Built-in algorithm with custom options
defineAlgorithm('gzip', { level: 9 })…

Description from the npm listing.

  • vite
  • vite-plugin
  • compress

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-compression2 weekly downloads on npm, last 90 days: 766,427 weekly downloads as of Dec 5, 2026, +68.6% over 90 days.vite-plugin-compression2Weekly downloads on npm · Last 90 days766,427downloads / week+68.6% over 90 days0200K400K600K800KSep 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-compression2 weekly downloads on npm, last 90 days: 766,427 weekly downloads as of Dec 5, 2026, +68.6% over 90 days.

7/30/90-day growth

vite-plugin-compression2 weekly downloads growth on npm: +10.9% over 7 days, +15.6% over 30 days, +68.6% over 90 days.vite-plugin-compression2Weekly downloads growth on npm766,427downloads / week now7-day growth+75,377 weekly downloads+10.9%30-day growth+103,419 weekly downloads+15.6%90-day growth+311,713 weekly downloads+68.6%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-compression2 weekly downloads growth on npm: +10.9% over 7 days, +15.6% over 30 days, +68.6% over 90 days.

Ranking history

vite-plugin-compression2 npm ranking history: currently #321 (by weekly downloads).vite-plugin-compression2npm ranking · by weekly downloads · Last 90 days#321current rank#310#320#330#340#350#360#370Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-compression2 npm ranking history: currently #321 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 3, #5 (overall #45)
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 (170)
Recent weekly downloads observations for vite-plugin-compression2
Date (UTC)Weekly downloadsChange vs. previous
766,427+13.7K
752,756+30.9K
721,884+31.1K
690,788+8.6K
682,214+6.7K
675,475-14.6K
690,033-1K
691,050-9.5K
700,564-23.3K
723,889-20.8K
744,693-7.6K
752,337+11.6K
740,689+20.4K
720,326—

Similar npm Vite plugins plugins

All 20 vite-plugin-compression2 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-compression2. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.