-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnext.config.ts
More file actions
40 lines (37 loc) · 1.55 KB
/
next.config.ts
File metadata and controls
40 lines (37 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
// Bundle splitting strategy: see docs/bundle-budget.md for the full chunk
// inventory and guidelines. Key points:
// - Framework baseline is ~152 kB gzipped (Next.js + React + shared providers)
// - Heavy deps (Sentry, Supabase, Lexical) are lazy-loaded via dynamic import
// - Per-route budget: 200 kB gzipped, enforced by `pnpm test:bundle`
// - Framework baseline budget: 160 kB gzipped, checked by the same script
const nextConfig: NextConfig = {
allowedDevOrigins: ["*.preview.devx.network", "*.preview.env.ona.dev"],
experimental: {
// Cache dynamic route RSC payloads for 30s on the client.
// Makes back/forward navigation instant instead of re-fetching.
staleTimes: {
dynamic: 30,
},
},
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
widenClientFileUpload: true,
tunnelRoute: "/monitoring",
silent: !process.env.CI,
// Disable client-side route manifest injection. The manifest adds ~800 bytes
// to the shared framework chunk. Sentry still captures route names via the
// server-side instrumentation; client transactions will use raw URLs instead
// of parameterized paths, which is acceptable for our traffic volume.
routeManifestInjection: false,
bundleSizeOptimizations: {
excludeDebugStatements: true,
excludeReplayShadowDom: true,
excludeReplayIframe: true,
excludeReplayWorker: true,
},
});