-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
62 lines (56 loc) · 1.66 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// @ts-check
import withPWAInit from '@ducanh2912/next-pwa'
import { withAxiom } from 'next-axiom'
import createNextIntlPlugin from 'next-intl/plugin'
/**
* Run `build` or `dev` script with `SKIP_ENV_VALIDATION` to skip validation
* of environment variables. This is especially useful for Docker builds.
*/
!process.env.SKIP_ENV_VALIDATION && (await import('./src/env.mjs'))
/** @type {import('next').NextConfig} */
const nextBaseConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: `${process.env.NEXT_PUBLIC_AWS_BUCKET_NAME ?? '*'}.s3.${
process.env.NEXT_PUBLIC_AWS_BUCKET_REGION ?? '*'
}.amazonaws.com`,
},
{
protocol: 'https',
hostname: 'begursecret.com',
},
{
protocol: 'https',
hostname: 'begursecret-mauriciabad.vercel.app',
},
{
protocol: 'https',
hostname: 'begursecret-*-mauriciabad.vercel.app',
},
],
unoptimized: process.env.VERCEL_ENV !== 'production',
},
}
/**
* Create config wrapper required for using next-intl with RSCs.
* See https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components
*/
const withNextIntl = createNextIntlPlugin('./src/server/i18n.ts')
const withPWA = withPWAInit({
dest: 'public',
fallbacks: {
image: '/fallback.png',
},
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
disable: process.env.NODE_ENV === 'development',
workboxOptions: {
disableDevLogs: true,
},
})
/** @type {import('next').NextConfig} */
const nextConfig = withAxiom(withNextIntl(withPWA(nextBaseConfig)))
export default nextConfig