Skip to content

Commit 4f8d112

Browse files
authored
Merge pull request #3023 from IntersectMBO/chore/add-server-side-compression-for-large-assets
chore: add server side compression for large assets
2 parents 46b9367 + 0415408 commit 4f8d112

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ changes.
2222
- Add mathematical styling for governance actions [Issue 2984](https://github.com/IntersectMBO/govtool/issues/2984)
2323
- Add script to update GovTool version
2424
- Add `isStakeKeyRegistered` for the usage by pillars [Issue 2384](https://github.com/IntersectMBO/govtool/issues/2384)
25+
- Add server side compression for large assets
2526

2627
### Fixed
2728

govtool/frontend/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
"storybook": "^8.4.7",
108108
"typescript": "^5.0.2",
109109
"vite": "^6.0.3",
110+
"vite-plugin-compression": "^0.5.1",
110111
"vitest": "^2.1.8"
111112
},
112113
"optionalDependencies": {

govtool/frontend/vite.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import path from "path";
22
import { defineConfig as defineViteConfig, mergeConfig } from "vite";
33
import { defineConfig as defineVitestConfig } from "vitest/config";
4+
import compression from "vite-plugin-compression";
45
import react from "@vitejs/plugin-react-swc";
56

67
const viteConfig = defineViteConfig({
7-
plugins: [react()],
8+
plugins: [
9+
react(),
10+
compression({
11+
algorithm: "brotliCompress",
12+
threshold: 1024 * 10,
13+
}),
14+
],
815
cacheDir: ".vite",
916
define: {
1017
"process.env": {},

govtool/frontend/yarn.lock

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5676,7 +5676,7 @@ debug@^3.2.7:
56765676
dependencies:
56775677
ms "^2.1.1"
56785678

5679-
debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.7, debug@4:
5679+
debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.7, debug@4:
56805680
version "4.3.7"
56815681
resolved "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz"
56825682
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
@@ -14609,6 +14609,15 @@ [email protected]:
1460914609
pathe "^1.1.2"
1461014610
vite "^5.0.0"
1461114611

14612+
vite-plugin-compression@^0.5.1:
14613+
version "0.5.1"
14614+
resolved "https://registry.npmjs.org/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz"
14615+
integrity sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==
14616+
dependencies:
14617+
chalk "^4.1.2"
14618+
debug "^4.3.3"
14619+
fs-extra "^10.0.0"
14620+
1461214621
vite-plugin-istanbul@^3.0.1:
1461314622
version "3.0.4"
1461414623
resolved "https://registry.npmjs.org/vite-plugin-istanbul/-/vite-plugin-istanbul-3.0.4.tgz"
@@ -14619,7 +14628,7 @@ vite-plugin-istanbul@^3.0.1:
1461914628
picocolors "^1.0.0"
1462014629
test-exclude "^6.0.0"
1462114630

14622-
vite@*, "vite@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "vite@^4 || ^5 || ^6", "vite@^4.0.0 || ^5.0.0 || ^6.0.0", vite@^6.0.0, vite@^6.0.3:
14631+
vite@*, "vite@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "vite@^4 || ^5 || ^6", "vite@^4.0.0 || ^5.0.0 || ^6.0.0", vite@^6.0.0, vite@^6.0.3, vite@>=2.0.0:
1462314632
version "6.0.11"
1462414633
resolved "https://registry.npmjs.org/vite/-/vite-6.0.11.tgz"
1462514634
integrity sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==

0 commit comments

Comments
 (0)