-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
35 lines (32 loc) · 1011 Bytes
/
Copy pathnext.config.ts
File metadata and controls
35 lines (32 loc) · 1011 Bytes
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
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
const r2Hostname = (() => {
try {
if (!process.env.R2_PUBLIC_URL) return null;
return new URL(process.env.R2_PUBLIC_URL).hostname;
} catch {
return null;
}
})();
const nextConfig: NextConfig = {
output: "standalone",
images: {
// Allow next/image to optimize images served from our R2 public bucket.
// Additional hosts can be added here as we expand storage.
remotePatterns: [
...(r2Hostname
? [{ protocol: "https" as const, hostname: r2Hostname }]
: []),
// Cloudflare R2 default subdomain pattern.
{ protocol: "https" as const, hostname: "*.r2.cloudflarestorage.com" },
{ protocol: "https" as const, hostname: "*.r2.dev" },
],
},
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
silent: !process.env.CI,
widenClientFileUpload: true,
disableLogger: true,
});