https://github.com/eye-wave/i-am-a-surgeon
astro build minifier with zero regard for sanity
https://github.com/eye-wave/i-am-a-surgeon
astro astro-integration astro-plugin minify minify-css minify-javascript svelte terser
Last synced: 26 days ago
JSON representation
astro build minifier with zero regard for sanity
- Host: GitHub
- URL: https://github.com/eye-wave/i-am-a-surgeon
- Owner: eye-wave
- License: gpl-3.0
- Created: 2025-06-06T18:21:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-06T19:22:27.000Z (12 months ago)
- Last Synced: 2025-06-06T19:34:01.985Z (12 months ago)
- Topics: astro, astro-integration, astro-plugin, minify, minify-css, minify-javascript, svelte, terser
- Language: TypeScript
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# i-am-a-surgeon



> [!WARNING]
> This was done as a half-joke, half-serious attempt at squeezing every last bit out of an Astro + Svelte build. If it’s not obvious already: **THIS IS NOT MEANT FOR PRODUCTION.**
When Astro finishes bundling, this thing crawls through `dist/` like a raccoon with ADHD, doing some or all of the following:
- **fontCleaner** – removes unused fonts
- **removeUnusedCssVariables** – if you’ve got a massive CSS theme and aren’t using most of it, this helps a bit
- **compressCssClasses** – shortens ugly Astro/Svelte classes like `svelte-x18sz2 → a` 👍👍
- **compressCssVariables** – turns every CSS variable into `--a`, `--b`, `--c`...
- **convertOklabToHex** – rewrites bulky OKLab values to short hex (3-digit when possible)
- **stripErrorMessages** – nukes error messages because who needs to debug, amirite
- **extraTerseHtml** – extra-aggressive HTML minification (Astro islands are spared... mostly)
- **leStupid** – commits semantic crimes by shortening well established syntax with Regular Expressions.
- **extraTerse** – more rounds of unsafe JS minification
- **compressFileNames** – renames every JS and CSS file to `a.js`, `b.css`, `c.js`, etc.
All of these are enabled by default, so you’ll need to opt out in the plugin options if something breaks. And trust me, it will.
Minification fails and you ship a broken site? — haha whoops 🐈
---
### Installation
⚠️ Don’t.
But if you want anyways:
```sh
bun add -d github:eye-wave/i-am-a-surgeon
```
~~Oh, and if you’re not using **Bun** or a **Unix-based OS**, this won’t work 😸~~
It **should** be crossplatform and work on node, but i haven't tested yet 🙀.
---
### 🧾 License
Licensed under the **GNU General Public License v3.0 (GPL-3.0)**.