A high-performance Go minifier for HTML5, CSS3, JS, JSON, SVG, and XML that shrinks web files without changing output.
Minify is a Go library and command-line tool that minifies web files—HTML, CSS, JavaScript, JSON, SVG, and XML—by removing unnecessary characters like whitespace and comments without altering their output. It solves the problem of large file sizes slowing down web transmission and parsing, offering a fast and reliable way to shrink assets.
Developers and DevOps engineers building web applications who need to optimize asset sizes for performance, especially those working with Go-based backends or CI/CD pipelines.
Developers choose Minify for its exceptional speed, often outperforming other minifiers by orders of magnitude, along with its safety-focused approach and extensibility for custom formats or external tools.
Go minifiers for web formats
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show it's orders of magnitude faster than alternatives like Terser or UglifyJS, with JavaScript minification at ~25MB/s, making it ideal for performance-critical workflows.
Handles HTML5, CSS3, JS, JSON, SVG, and XML with embedded resources, using robust parsers instead of error-prone regexes for reliable minification across web files.
Implements safe transformations that don't break output, backed by fuzz testing and 100% test coverage, with options to preserve comments or whitespace when needed.
Allows adding custom minifiers or redirecting to external tools like Closure Compiler based on MIME types, and includes HTTP middleware for on-the-fly minification in Go apps.
The roadmap admits the SVG minifier is 'very slow' and needs improvement, which can hinder performance for asset-heavy projects relying on SVG graphics.
Lacks source map generation, a common feature in other minifiers, making debugging minified code more difficult and listed as uncertain in the roadmap due to performance concerns.
Purposely avoids advanced optimizations like CSS ruleset merging or aggressive JS transformations, potentially resulting in larger files compared to tools like UglifyJS or Closure Compiler.