web-crush-cli
v1.2.0
Published
A brutal, zero-config minifier for vanilla web projects.
Maintainers
Readme
🔨 Web-Crush
The Zero-Config Minifier for Vanilla Web Projects.
Great build tools already exist. But installing them, configuring them, and writing build scripts just to minify a simple project is time-consuming.
Web-Crush cuts out the setup. It takes your raw HTML, CSS, and JS, crushes them into a production-ready public folder, and gets out of your way.
⚡ Why?
We aren't trying to replace Vite or Webpack. They are excellent. But for a simple portfolio or landing page, setting up a complex build pipeline feels like overkill.
Web-Crush is for when you just want to finish:
- Zero Config: No setup. Just run it in your project's root folder, and boom—everything is done.
- Lightweight: Installs in seconds (~10MB).
- Recursive: Handles nested folders and complex structures automatically.
🚀 Usage
You don't even need to install it. Go to your project root and run:
npx web-crush-cliWhat happens next?
- Recursive Scan: It finds all
.html,.css, and.jsfiles in your root and every subfolder. - Minification: It compresses code using industry-standard engines (
terser,clean-css,html-minifier). - Universal Passthrough: It automatically copies everything else (images, fonts, PDFs,
robots.txt,favicon.ico) exactly as is, preserving the folder structure. - Deployment Ready: It outputs everything into a clean
public/folder.
⚙️ Configuration (Optional)
Happy with the defaults? Do nothing.
Need control? Create a web-crush.config.json file in your project root:
{
"outDir": "public", // Default: "public"
"verbose": true, // Default: true
"dropConsole": false, // Default: false (Set to true to strip console.logs)
"exclude": ["drafts/**"] // Default: [] (Files/folders to ignore)
}(Note: You no longer need to define an assets folder. Web-Crush now auto-detects assets anywhere in your project.)
🛡️ Features
1. Deep Recursion
No need to list your files. Whether your file is index.html or deeply nested in blog/2025/posts/article.html, Web-Crush finds it, minifies it, and outputs it to the correct folder.
2. Recruiter Safe Mode
Most minifiers strip console.log to save space. Web-Crush keeps them.
Why? Because many developers leave "Hello there!" messages for technical recruiters in the console. We respect the hustle.
(Want them gone? Set
"dropConsole": truein your config).
3. Universal Passthrough
Web-Crush scans for everything. If it's code, it gets crushed. If it's not code, it gets copied.
- ✅
favicon.icoin root? Copied. - ✅
sitemap.xmlorrobots.txt? Copied. - ✅
images/,fonts/, orvideos/? Copied.
(Got something you don't want copied? Add it to
excludein your config).
📂 Example Structure
Before (npx web-crush-cli):
My-Portfolio/
├── images/
│ └── me.jpg
├── blog/
│ └── post-1.html (Nested file)
├── index.html (400 lines, messy)
├── style.css (50kb, comments everywhere)
└── favicon.icoAfter:
My-Portfolio/
├── public/ <-- DEPLOY THIS FOLDER
│ ├── images/ (Copied)
│ ├── blog/
│ │ └── post-1.html (Minified)
│ ├── index.html (One line, tiny)
│ ├── style.css (Compressed)
│ └── favicon.ico (Copied)
└── ...👤 Author
Anson Jaison
- Website: anson.is-a.dev
- GitHub: @ansonjaison
- LinkedIn: Anson Jaison
📄 License
MIT © Anson Jaison
