Goat Minify is a code minification / compression tool. It runs entirely in your browser, ensuring maximum privacy and speed.
It supports JavaScript, CSS, HTML, XML, JSON, YAML, TOML, and Markdown, featuring auto-detection, syntax highlighting, and granular compression levels.
Try it out now: https://github.com/dcog989/Goat-Minify
- Privacy First: All processing happens locally using Web Workers and bundled compilers.
- Multi-Language:
- JS/JSON: Powered by Terser.
- CSS: Powered by PostCSS + cssnano.
- HTML/XML/SVG: Powered by html-minifier-terser.
- Data (YAML/TOML): Structure-aware whitespace removal.
- Markdown: Frontmatter preservation and whitespace optimization.
- Smart Detection: Heuristic analysis to detect code type (even without file extensions).
- Developer Experience:
- Syntax Highlighting (Highlight.js) with line numbers.
- Drag-and-drop file upload.
- Minification Levels (1-4) for fine-grained control.
- Accessibility: Fully accessible (ARIA support, keyboard navigation, high contrast compatibility).
This project is built with Vite 7 and utilizes a modular ES6 architecture.
- Node.js (v18 or higher recommended)
-
Clone the repository:
git clone https://github.com/dcog989/Goat-Minify.git cd Goat-Minify -
Install dependencies:
npm install
-
Start the development server:
npm run dev
Open the URL shown in the terminal (usually
http://localhost:3000).
To create a deployable static site:
npm run buildThe output will be in the dist/ folder.
To test the production build locally (verifying bundle loading and polyfills):
npm run preview├── css/
│ ├── stylish.css # Main themes and layout
│ └── accessibility.css # ARIA, focus, and motion handling
├── js/
│ ├── GoatMinify.improved.js # Main entry point
│ └── modules/
│ ├── constants.js # Regex patterns and config
│ ├── detector.js # Language detection logic
│ ├── minification-engines.js # Interface to compilers (Terser/PostCSS)
│ ├── polyfills.js # Node.js environment shims for browser
│ ├── storage.js # Safe localStorage wrapper
│ ├── ui-core.js # UI manipulation (highlights, scrolling)
│ ├── utils.js # Debounce, formatting helpers
│ ├── fs-stub.js # Virtual file system for cssnano
│ ├── os-stub.js # Virtual OS module
│ └── url-stub.js # Virtual URL module
├── vite.config.js # Build configuration & polyfill mapping
└── index.html
This is a Static Web App. You can deploy the dist/ folder to any static host:
- GitHub Pages: (Recommended) Push to a
gh-pagesbranch or use a GitHub Action. - Netlify / Vercel / Cloudflare Pages: Drag and drop the
distfolder. - Apache / Nginx: Upload contents to your web root.
Note: You cannot run the index.html directly via the file system (file://) due to browser security restrictions on ES Modules. You must serve it via a web server.
Built on the shoulders of giants:
MIT