https://github.com/milesbarr/web-minifier
A Python tool for minifying web assets.
https://github.com/milesbarr/web-minifier
css html json minification minifier minify python python3 svg web-app-manifest website xhtml xml
Last synced: 10 months ago
JSON representation
A Python tool for minifying web assets.
- Host: GitHub
- URL: https://github.com/milesbarr/web-minifier
- Owner: milesbarr
- License: mit
- Created: 2024-01-06T05:43:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-16T15:38:12.000Z (10 months ago)
- Last Synced: 2025-03-16T16:33:14.831Z (10 months ago)
- Topics: css, html, json, minification, minifier, minify, python, python3, svg, web-app-manifest, website, xhtml, xml
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
# 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:
```bash
python -m webminifier -i input.html -o output.html
```
Minify all supported files in a directory:
```bash
python -m webminifier -i src/ -o dist/
```
Recursively minify files in a directory and its subdirectories:
```bash
python -m webminifier -i src/ -o dist/ -r
```
## License
This project is licensed under the [MIT license](LICENSE).