-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.mjs
43 lines (38 loc) · 1.24 KB
/
next.config.mjs
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
import { withAxiom } from 'next-axiom'
import createNextIntlPlugin from 'next-intl/plugin'
import { withPlausibleProxy } from 'next-plausible'
const withNextIntl = createNextIntlPlugin()
/**
* Undefined entries are not supported. Push optional patterns to this array only if defined.
* @type {import('next/dist/shared/lib/image-config').RemotePattern}
*/
const remotePatterns = [
{ hostname: 'avatars.githubusercontent.com' },
{ hostname: 'basehub.earth' },
]
// S3 Storage
if (process.env.S3_UPLOAD_ENDPOINT) {
// custom endpoint for providers other than AWS
const url = new URL(process.env.S3_UPLOAD_ENDPOINT)
remotePatterns.push({
hostname: url.hostname,
})
} else if (process.env.S3_UPLOAD_BUCKET && process.env.S3_UPLOAD_REGION) {
// default provider
remotePatterns.push({
hostname: `${process.env.S3_UPLOAD_BUCKET}.s3.${process.env.S3_UPLOAD_REGION}.amazonaws.com`,
})
}
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns,
},
// Required to run in a codespace (see https://github.com/vercel/next.js/issues/58019)
experimental: {
serverActions: {
allowedOrigins: ['localhost:3000'],
},
},
}
export default withAxiom(withPlausibleProxy()(withNextIntl(nextConfig)))