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 · Oct 17, 2026

vite-plugin-compression2 has 222,170 recorded weekly downloads on npm, a decrease of 50.0% over the past 30 days.

It ranks #366 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -36.6%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
222,170
Official API · Oct 17, 2026
7-day growth
-55.0%
-271.7K weekly downloads
30-day growth
-50.0%
-221.9K weekly downloads
90-day growth
-36.6%
-128.4K weekly downloads
Rank
#366
Among tracked npm listings

About vite-plugin-compression2

Install

Usage

Basic Usage

Multiple Algorithms

Custom Algorithm Function

With Tarball

Options

Compression Plugin Options

| params | type | default | description |

| include | string \| RegExp \| Array | /\.(html\|xml\|css\|json\|js\|mjs\|svg\|yaml\|yml\|toml)$/ | Include all assets matching any of these conditions. | | exclude | string \| RegExp \| Array | - | Exclude all assets matching any of these conditions. | | threshold | number | 0 | Only assets bigger than this size are processed (in bytes) | | algorithms | Algorithms | ['gzip', 'brotliCompress'] | Array of compression algorithms or defineAlgorithm results | | filename | string \| function | [path][base].gz or [path][base]. br If algorithm is zstandard be [path][base].zst | The target asset filename pattern | | deleteOriginalAssets | boolean | false | Whether to delete the original assets or not | | skipIfLargerOrEqual | boolean | true | Whether to skip the compression if the result is larger than or equal to the original file | | logLevel | string | info | Control sdout info | | artifacts | function | undefined | Sometimes you need to copy something to the final output. This option may help you. | | scheduler | SchedulerOptions | undefined | Limit concurrency |

Tarball Plugin Options

| params | type | default | description |

| dest | string | - | 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:

Supported Algorithms

| Algorithm | Aliases | Extension | Node.js Support | Description |

| gzip | gz | .gz | All versions | Standard gzip compression with good balance of speed and ratio | | brotliCompress | brotli, br | .br | All versions | Brotli compression with better compression ratio than gzip | | deflate | - | .gz | All versions | Deflate compression algorithm | | deflateRaw | - | .gz | All versions | Raw deflate compression without headers | | zstandard | zstd | .zst | >= 22.15.0 or >= 23.8.0 | Zstandard compression with excellent speed/ratio balance | | Custom Function | - | Custom | All versions | Your own compression algorithm implementation |

Algorithm Types

The algorithms option accepts:

Migration

If you're upgrading from v1.x, please check the Migration Guide.

Q & A

FAQ

Examples

Basic Gzip Only

Multiple Algorithms with Custom Options

Custom Filename Pattern

Delete Original Files

Size Threshold

Production Deployment

After building your project with compressed assets, you need to configure your web server to serve these pre-compressed files.

Nginx Configuration

Apache Configuration

Performance Tips

Compression Level Selection

Choose compression levels based on your deployment strategy:

Recommendations:

• Development/CI: Level 6 (gzip) or Quality 4-6 (brotli) - faster builds • Production: Level 9 (gzip) or Quality 10-11 (brotli) - best compression • Balance: Level 7-8 (gzip) or Quality 8-9 (brotli) - good compromise

File Size Threshold

Only compress files that benefit from compression:

Why use a threshold?

• Files smaller than 1KB may not benefit from compression • HTTP overhead can make tiny compressed files slower • Saves build time and disk space

Multi-Algorithm Strategy

Use both gzip and brotli for maximum compatibility and performance:

Benefits:

• Brotli: 15-20% better compression than gzip • Gzip: Fallback for older browsers • Server automatically serves the best format based on Accept-Encoding header

Selective Compression

Compress only specific file types for optimal results:

File types that compress well:

• JavaScript/TypeScript (.js, .mjs, .ts) • CSS (.css) • HTML (.html) • JSON (.json) • SVG (.svg) • XML (.xml)

File types to skip:

• Images (.png, .jpg, .webp) - already compressed • Fonts (.woff, .woff2) - already compressed • Videos (.mp4, .webm) - already compressed

Others

• If you want to analyze your bundle assets, try vite-bundle-analyzer • tarball option dest means to generate a tarball somewhere • tarball is based on the ustar format. It should be compatible with all popular tar distributions (gnutar, bsdtar etc)

Node.js Version Requirements

• gzip, brotliCompress, deflate, deflateRaw: All Node.js versions supported • zstd: Requires Node.js >= 22.15.0 or >= 23.8.0

Note: If you try to use zstd compression on an unsupported Node.js version, the plugin will throw a helpful error message indicating the required version.

Sponsors

LICENSE

MIT

Acknowledgements

NWYLZW

Author

Kanno

Description from the npm listing.

  • vite
  • vite-plugin
  • compress

Where vite-plugin-compression2 sits in the listing

Each band is one page of 20. Weekly downloads on a log 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.

All npm2,248 listings · 113 pages · page 19, #6 (overall #366)
All npm: every listing in weekly downloads order
PNG SVG
Vite plugins250 listings · 13 pages · page 3, #3 (overall #43)
Vite plugins: every listing in weekly downloads order
PNG SVG

Charts

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

Adoption over time

vite-plugin-compression2 weekly downloads on npm, last 90 days: 222,170 weekly downloads as of Oct 17, 2026, -36.6% over 90 days.vite-plugin-compression2Weekly downloads on npm · Last 90 days222,170downloads / week-36.6% over 90 days200K250K300K350K400K450K500K550K600KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
vite-plugin-compression2 weekly downloads on npm, last 90 days: 222,170 weekly downloads as of Oct 17, 2026, -36.6% over 90 days.
PNG SVG

7/30/90-day growth

vite-plugin-compression2 weekly downloads growth on npm: -55.0% over 7 days, -50.0% over 30 days, -36.6% over 90 days.vite-plugin-compression2Weekly downloads growth on npm222,170downloads / week now7-day growth-271,734 weekly downloads-55.0%30-day growth-221,930 weekly downloads-50.0%90-day growth-128,434 weekly downloads-36.6%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-plugin-compression2 weekly downloads growth on npm: -55.0% over 7 days, -50.0% over 30 days, -36.6% over 90 days.
PNG SVG

Ranking history

vite-plugin-compression2 npm ranking history: currently #366 (by weekly downloads).vite-plugin-compression2npm ranking · by weekly downloads · Last 90 days#366current rank#364#365#366#367#368Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
vite-plugin-compression2 npm ranking history: currently #366 (by weekly downloads).
PNG SVG

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.

Recent observations

Full history (121)
Recent weekly downloads observations for vite-plugin-compression2
Date (UTC)Weekly downloadsChange vs. previous
222,170-39.3K
261,467-4.4K
265,861-113.4K
379,271-104.4K
483,6690
483,669-7.3K
490,983-2.9K
493,904-3.9K
497,787+5.5K
492,247+4.6K
487,649-4.6K
492,237-103.1K
595,379+409
594,970—

Similar npm Vite plugins plugins

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 Oct 18, 2026. See the methodology.