-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathnext.config.ts
More file actions
56 lines (49 loc) · 1.42 KB
/
next.config.ts
File metadata and controls
56 lines (49 loc) · 1.42 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { withSentryConfig } from "@sentry/nextjs";
import type { NextConfig } from "next";
import { SENTRY_TUNNEL_PATH } from "./lib/monitoring/sentry-config";
import { buildNextProductionHeaderRules } from "./lib/vercel/production-headers";
const nextConfig: NextConfig = {
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: "https",
hostname: "robohash.org",
},
{
protocol: "https",
hostname: "ik.imagekit.io",
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
},
],
formats: ["image/avif", "image/webp"],
},
compiler: {
removeConsole: process.env.NODE_ENV === "production",
},
poweredByHeader: false,
experimental: {
optimizePackageImports: ["@/components", "@/lib"],
},
// Security + /_next/static immutable cache — see lib/vercel/production-headers.ts
async headers() {
return buildNextProductionHeaderRules();
},
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG ?? "arnob-mahmuds-org",
project: process.env.SENTRY_PROJECT ?? "stock-inventory",
silent: !process.env.CI,
widenClientFileUpload: true,
// First-party tunnel — must match `tunnel` in instrumentation-client.ts (SENTRY_TUNNEL_PATH)
tunnelRoute: SENTRY_TUNNEL_PATH,
webpack: {
automaticVercelMonitors: true,
treeshake: {
removeDebugLogging: true,
},
},
});