mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
help: Pre compress astro build files before serving.
This way nginx doesn't have to compress it every time.
This commit is contained in:
committed by
Alex Vandiver
parent
1a34016e4a
commit
57b7ada2e4
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -549,6 +549,9 @@ importers:
|
|||||||
astro:
|
astro:
|
||||||
specifier: ^5.1.2
|
specifier: ^5.1.2
|
||||||
version: 5.13.5(@types/node@22.18.1)(encoding@0.1.13)(jiti@2.5.1)(rollup@4.50.0)(terser@5.44.0)(typescript@5.9.2)(yaml@2.8.1)
|
version: 5.13.5(@types/node@22.18.1)(encoding@0.1.13)(jiti@2.5.1)(rollup@4.50.0)(terser@5.44.0)(typescript@5.9.2)(yaml@2.8.1)
|
||||||
|
astro-compressor:
|
||||||
|
specifier: ^1.1.2
|
||||||
|
version: 1.1.2
|
||||||
hast-util-from-html:
|
hast-util-from-html:
|
||||||
specifier: ^2.0.3
|
specifier: ^2.0.3
|
||||||
version: 2.0.3
|
version: 2.0.3
|
||||||
@@ -3265,6 +3268,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==}
|
resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
astro-compressor@1.1.2:
|
||||||
|
resolution: {integrity: sha512-BsX6ypOkRff2g7e5vA47Vlpq9MfVxAo4pXzfkJvXTSzzrSYvf8m3e0lbyGK6eReSzWcAPXymOTIoooqDX1BTlA==}
|
||||||
|
engines: {node: '>=22.15.0 <23.0.0 || >=23.8.0'}
|
||||||
|
|
||||||
astro-eslint-parser@1.2.2:
|
astro-eslint-parser@1.2.2:
|
||||||
resolution: {integrity: sha512-JepyLROIad6f44uyqMF6HKE2QbunNzp3mYKRcPoDGt0QkxXmH222FAFC64WTyQu2Kg8NNEXHTN/sWuUId9sSxw==}
|
resolution: {integrity: sha512-JepyLROIad6f44uyqMF6HKE2QbunNzp3mYKRcPoDGt0QkxXmH222FAFC64WTyQu2Kg8NNEXHTN/sWuUId9sSxw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
@@ -12948,6 +12955,8 @@ snapshots:
|
|||||||
|
|
||||||
astring@1.9.0: {}
|
astring@1.9.0: {}
|
||||||
|
|
||||||
|
astro-compressor@1.1.2: {}
|
||||||
|
|
||||||
astro-eslint-parser@1.2.2:
|
astro-eslint-parser@1.2.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@astrojs/compiler': 2.12.2
|
'@astrojs/compiler': 2.12.2
|
||||||
|
@@ -36,10 +36,7 @@ location ~ ^(/help(?:/[^/]+)*)/+$ {
|
|||||||
location /help {
|
location /help {
|
||||||
alias $help_alias;
|
alias $help_alias;
|
||||||
|
|
||||||
gzip on;
|
gzip_static on;
|
||||||
gzip_min_length 1000;
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
include /etc/nginx/zulip-include/headers;
|
include /etc/nginx/zulip-include/headers;
|
||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
add_header Timing-Allow-Origin *;
|
add_header Timing-Allow-Origin *;
|
||||||
|
@@ -4,6 +4,7 @@ import * as fs from "node:fs";
|
|||||||
|
|
||||||
import starlight from "@astrojs/starlight";
|
import starlight from "@astrojs/starlight";
|
||||||
import {defineConfig, envField} from "astro/config";
|
import {defineConfig, envField} from "astro/config";
|
||||||
|
import compressor from "astro-compressor";
|
||||||
import Icons from "unplugin-icons/vite";
|
import Icons from "unplugin-icons/vite";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
@@ -73,6 +74,11 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
integrations: [
|
integrations: [
|
||||||
|
compressor({
|
||||||
|
gzip: true,
|
||||||
|
brotli: false,
|
||||||
|
zstd: false,
|
||||||
|
}),
|
||||||
starlight({
|
starlight({
|
||||||
title: "Zulip help center",
|
title: "Zulip help center",
|
||||||
favicon: "../static/images/favicon.svg",
|
favicon: "../static/images/favicon.svg",
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
"@astrojs/starlight": "^0.35.1",
|
"@astrojs/starlight": "^0.35.1",
|
||||||
"@iconify-json/fa": "^1.2.1",
|
"@iconify-json/fa": "^1.2.1",
|
||||||
"astro": "^5.1.2",
|
"astro": "^5.1.2",
|
||||||
|
"astro-compressor": "^1.1.2",
|
||||||
"hast-util-from-html": "^2.0.3",
|
"hast-util-from-html": "^2.0.3",
|
||||||
"hast-util-to-html": "^9.0.5",
|
"hast-util-to-html": "^9.0.5",
|
||||||
"mdast-util-to-string": "^4.0.0",
|
"mdast-util-to-string": "^4.0.0",
|
||||||
|
@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 425
|
|||||||
# historical commits sharing the same major version, in which case a
|
# historical commits sharing the same major version, in which case a
|
||||||
# minor version bump suffices.
|
# minor version bump suffices.
|
||||||
|
|
||||||
PROVISION_VERSION = (348, 0) # bumped 2025-09-10 to downgrade sharp
|
PROVISION_VERSION = (348, 1) # bumped 2025-09-10 to add astro-compressor.
|
||||||
|
Reference in New Issue
Block a user