macana

Static site generator for Obsidian Vault

Minify CSS Before: raw=16kB, gzip=3.63kB After: raw=12.44kB, gzip=3.27kB Added build time (Mac mini M1): 15ms~25ms To be honest, I don't think this compression result is not worth the added build time. However, the reduced 3.5kB could reduce consuming memory and CPU times... few micro seconds? I commit this since the journey to find a CSS minify library that was compatible with Deno is extremely tiresome... * `cssnano` imports `caniuse` even though related optimizations are disabled. It statically loads the module hence the access to `<CWD>` (and probably more places like `~/.config` idk), which requires completely unnecessary broad permissions. * `esbuild` is simple and great tool, but WASM is second-class citizen in Deno: requires `--allow-net=deno.land` (or `esm.sh`) or `--allow-read=<vendored path>`. One can embed WASM binary as a base64 or `JSON.parse("Uint8Array")`, but WASM binary of ESBuild weighs 30MB. I tried to open the generated file using the latter method and my nvim froze for minutes, which I had to `kill`. * `lightningcss` looks great, but this is WASM too and weighs 10MB. Better than ESBuild though. * `clean-css` declares itself as in maintenance mode. I tested it but it loads environment variables at init time and access to `cwd`. In the end, CSSO is the only ESM compatible library that works on web platform.

Changes

3 changed files (+13/-1)