-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
33 lines (30 loc) · 1.04 KB
/
next.config.js
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
/** @type {import("next").NextConfig} */
const nextConfig = () => {
const environmentVariables = [
'NEXT_PUBLIC_BASE_URL',
'NEXT_IMAGE_WHITELIST_HOSTNAMES',
'DATABASE_URL',
'NEXT_PUBLIC_GOOGLE_CLIENT_ID',
'NEXT_PUBLIC_GOOGLE_CLIENT_SECRET',
'NEXT_PUBLIC_NEXTAUTH_SECRET',
'AWS_UPLOAD_BUCKET_STREAMING',
'AWS_UPLOAD_BUCKET_REKOGNITION',
'AWS_UPLOAD_REGION_CANADA',
'AWS_UPLOAD_REGION_US',
'AWS_STREAMING_BUCKET',
]
// Check if all environment variables are set
const missingVariables = environmentVariables.filter((variable) => !process.env[variable])
if (missingVariables.length > 0) {
const errorMessage = `The environment variables are missing: ${ missingVariables.join(', ') }`
throw new ReferenceError(errorMessage)
}
return {
images: {
domains: process.env.NEXT_IMAGE_WHITELIST_HOSTNAMES.split(' '),
},
output: 'standalone',
reactStrictMode: false,
}
}
module.exports = nextConfig