mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Adds frontend/scripts/precompress.js, a Node script that walks assets/static/build/ and emits .gz (zlib level 9) and .zst (zlib level 19) siblings for every JS, CSS, JSON, SVG, font, source map, and small text asset. Already-encoded binaries (woff2, png, jpg, ...) and no-savings files (smaller than 1 KiB or compressing to >95% of source) are skipped. Every emitted sibling is round-tripped through gunzipSync / zstdDecompressSync so a corrupt sibling never reaches disk. Wired as the npm `postbuild` hook so `npm run build` produces siblings, and as `prewatch` (`--clean`) so `npm run watch` removes any stale siblings from a prior production build before webpack's first emit. The built-in node:zlib zstd API requires Node 22.15 or later; engines constraint bumped accordingly and frontend/tests/README.md aligned. |
||
|---|---|---|
| .. | ||
| precompress.js | ||