mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-30 03:39:26 -07:00
We can save 10 kB of binary size by compressing the frontend using brotli on max settings instead of gzip. Any browser beyond 2017 will be able to handle this, and since the Tailwind upgrade we already require browsers from 2024. (see also #903) Also we can stop using whatever gzlip cli is on the system, node has some stuff builtin. Source for the claim we require chrome 2023/firefox 2024 baseline right now: https://tailwindcss.com/docs/compatibility Compression comparison: | codec | size (bytes) | vs gzip -9 | wire format | `Content-Encoding` | |---|---:|---:|---|---| | (uncompressed) | 171,833 | +210.6% | — | — | | gzip -9 | 55,313 | — | gzip | `gzip` | | pigz -9 | 55,436 | +0.2% | gzip | `gzip` | | brotli q=4 | 55,085 | -0.4% | brotli | `br` | | brotli q=6 | 51,518 | -6.9% | brotli | `br` | | brotli q=9 | 51,243 | -7.4% | brotli | `br` | | **pigz -11** (zopfli) | **53,340** | **-3.6%** (~2 KB) | **gzip** | `gzip` | | **brotli q=11** | **47,712** | **-13.7%** (~7.4 KB) | **brotli** | `br` |
41 lines
1.4 KiB
JSON
41 lines
1.4 KiB
JSON
{
|
|
"name": "web",
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build && node ./scripts/compress-index.js",
|
|
"preview": "vite preview",
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
"test:unit": "vitest",
|
|
"test": "npm run test:unit -- --run",
|
|
"format": "prettier --write .",
|
|
"lint": "prettier --check . && eslint .",
|
|
"fix": "eslint --fix ."
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
"@sveltejs/adapter-static": "^3.0.5",
|
|
"@sveltejs/kit": "^2.58.0",
|
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
"@tailwindcss/vite": "^4.2.2",
|
|
"@types/eslint": "^9.6.0",
|
|
"@types/node": "^25.6.0",
|
|
"eslint": "^10.2.1",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-svelte": "^3.17.1",
|
|
"globals": "^17.5.0",
|
|
"prettier": "^3.8.3",
|
|
"prettier-plugin-svelte": "^3.5.1",
|
|
"svelte": "^5.55.5",
|
|
"svelte-check": "^4.4.6",
|
|
"tailwindcss": "^4.2.2",
|
|
"typescript": "^6.0.3",
|
|
"typescript-eslint": "^8.59.0",
|
|
"vite": "^8.0.10",
|
|
"vitest": "^4.1.5"
|
|
}
|
|
}
|