Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Web Performance Optimization
  3. Compression webpack plugin

Compression webpack plugin

MITJavaScriptv12.0.0

A webpack plugin that generates compressed versions of assets (gzip, Brotli, etc.) for serving with Content-Encoding.

GitHubGitHub
1.4k stars110 forks0 contributors

What is Compression webpack plugin?

Compression Webpack Plugin is a webpack plugin that generates compressed versions of static assets like JavaScript, CSS, and HTML files during the build process. It solves the problem of reducing file sizes for web assets by creating pre-compressed files that servers can deliver with Content-Encoding headers, improving website performance and reducing bandwidth usage.

Target Audience

Web developers and DevOps engineers using webpack who need to optimize asset delivery for production websites and applications.

Value Proposition

Developers choose this plugin because it integrates directly into the webpack build pipeline, supports multiple compression algorithms (gzip, Brotli, Zstandard), and offers fine-grained control over which assets get compressed and how, with minimal configuration overhead.

Overview

Prepare compressed versions of assets to serve them with Content-Encoding

Use Cases

Best For

  • Reducing bundle sizes for production web applications
  • Implementing Brotli compression for modern browsers
  • Pre-compressing static assets for CDN delivery
  • Optimizing webpack builds for better Core Web Vitals scores
  • Generating multiple compression formats (gzip + Brotli) for compatibility
  • Conditional compression based on file size or type

Not Ideal For

  • Projects using bundlers other than webpack, such as Vite or Rollup
  • Applications requiring real-time compression for dynamically generated content
  • Simple static sites where server-level compression is already sufficient
  • Environments with strict build time constraints where compression overhead is prohibitive

Pros & Cons

Pros

Multi-Algorithm Support

Supports gzip, Brotli, Zstandard, and custom algorithms via Node.js zlib or external libraries, enabling adaptation to different browser capabilities and performance goals.

Fine-Grained Asset Control

Offers filtering by size threshold, compression ratio, and file patterns, allowing precise targeting of assets to optimize build efficiency and output.

Customizable Output Naming

Provides template placeholders and function-based filename generation, facilitating organized file structures for compressed assets.

Webpack Ecosystem Integration

Designed as a first-class webpack plugin, it integrates seamlessly into build pipelines with sensible defaults and extensive configuration options.

Cons

Configuration Complexity

The plethora of options, from custom algorithms to compression parameters, can be overwhelming and error-prone for developers unfamiliar with compression tuning.

Build Time Overhead

Compression, especially at high levels or for large assets, adds significant processing time to builds, which can slow down development and CI/CD pipelines.

Node.js Version Dependencies

Advanced algorithms like Brotli and Zstandard require specific Node.js versions (e.g., 10.16.0+ for Brotli), limiting compatibility in older or constrained environments.

Frequently Asked Questions

Quick Stats

Stars1,428
Forks110
Contributors0
Open Issues3
Last commit1 month ago
CreatedSince 2013

Tags

#performance-optimization#brotli#gzip#nodejs#zstd#webpack-plugin#build-tool

Built With

N
Node.js
W
Webpack

Included in

Web Performance Optimization8.9k
Auto-fetched 1 hour ago

Related Projects

Webpack bundle analyzerWebpack bundle analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap

Stars12,672
Forks507
Last commit21 hours ago
Bundle SizeBundle Size

Keep your bundle size in check

Stars4,476
Forks177
Last commit1 year ago
source-map-explorersource-map-explorer

Analyze and debug space usage through source maps

Stars3,930
Forks111
Last commit3 years ago
BundleStatsBundleStats

Analyze bundle stats(bundle size, assets, modules, packages) and compare the results between different builds. Support for webpack, rspack, vite, rolldown and rollup.

Stars670
Forks22
Last commit3 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub