Skip to content

milesbarr/web-minifier

Repository files navigation

Web Minifier

A Python tool for minifying web assets by removing unnecessary whitespace, comments, and other redundant content while preserving functionality.

Features

Supports minification of common web file formats:

  • HTML (.html, .htm, .xhtml)
  • CSS (.css)
  • JSON (.json, .webmanifest)
  • XML (.xml, .rss, .atom, .svg)

All minification preserves full functionality while reducing file size.

Installation

# Clone the repository
git clone https://github.com/milesbarr/web-minifier.git
cd web-minifier

# Install the package
pip install .

Usage

Command-Line Interface

Minify a single file:

python -m webminifier -i input.html -o output.html

Minify all supported files in a directory:

python -m webminifier -i src/ -o dist/

Recursively minify files in a directory and its subdirectories:

python -m webminifier -i src/ -o dist/ -r

License

This project is licensed under the MIT license.