-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathnext.config.ts
More file actions
104 lines (97 loc) · 2.41 KB
/
Copy pathnext.config.ts
File metadata and controls
104 lines (97 loc) · 2.41 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import type { NextConfig } from "next";
const rawBasePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
// Remove all slashes and add a leading slash if not empty
const normalizedBasePath = rawBasePath.replace(/\//g, "");
const basePath = normalizedBasePath ? `/${normalizedBasePath}` : "";
const nextConfig: NextConfig = {
output: "standalone", // Required for the Docker setup
basePath: basePath,
assetPrefix: basePath,
env: {
BUILD_TIMESTAMP: process.env.BUILD_TIMESTAMP,
VERSION_DEPLOYED: process.env.VERSION_DEPLOYED,
DEPLOYMENT_URL: process.env.DEPLOYMENT_URL,
BUILD_DATE: process.env.BUILD_DATE,
COMMIT_HASH: process.env.COMMIT_HASH,
},
// Exclude Application Insights from server-side bundling to avoid dynamic require issues
// This tells Next.js to use the Node.js runtime version instead of bundling it
serverExternalPackages: [
'applicationinsights',
'diagnostic-channel',
'diagnostic-channel-publishers',
],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "assets.tina.io",
port: "",
},
{
protocol: "https",
hostname: "res.cloudinary.com",
port: "",
},
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
port: "",
},
{
protocol: "https",
hostname: "raw.githubusercontent.com",
port: "",
},
{
protocol: "https",
hostname: "adamcogan.com",
port: "",
},
{
protocol: "https",
hostname: "github-production-user-asset-*",
port: "",
},
{
protocol: "https",
hostname: "images.unsplash.com",
port: "",
},
{
protocol: "https",
hostname: "tv.ssw.com",
port: "",
},
],
},
async headers() {
const headers = [
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "Content-Security-Policy",
value: "frame-ancestors 'self'",
},
];
return [
{
source: "/(.*)",
headers,
},
];
},
async rewrites() {
return [
{
source: "/admin",
destination: "/admin/index.html",
},
{ source: "/_next/:path*", destination: "/_next/:path*" },
{ source: "/.well-known/:path*", destination: "/.well-known/:path*" },
];
},
};
export default nextConfig;