-
Notifications
You must be signed in to change notification settings - Fork 45
/
next.config.js
85 lines (82 loc) · 2.45 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
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
/**
* @type {import('next').NextConfig}
*/
const runtimeCaching = require('next-pwa/cache');
const withPWA = require('next-pwa')({
dest: 'public',
runtimeCaching,
buildExcludes: ['app-build-manifest.json'],
disable: process.env.NODE_ENV === 'development',
});
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer(
withPWA({
reactStrictMode: true,
publicRuntimeConfig: {
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL,
NEXT_PUBLIC_VERCEL_BRANCH_URL: process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL,
NEXT_PUBLIC_ENV: process.env.NEXT_PUBLIC_ENV,
NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA: process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN: process.env.NEXT_PUBLIC_ROLLBAR_CLIENT_TOKEN,
NEXT_PUBLIC_SIMPLYBOOK_WIDGET_URL: process.env.NEXT_PUBLIC_SIMPLYBOOK_WIDGET_URL,
NEXT_PUBLIC_CRISP_WEBSITE_ID: process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID,
NEXT_PUBLIC_HOTJAR_ID: process.env.NEXT_PUBLIC_HOTJAR_ID,
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID: process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID,
},
compiler: {
emotion: true,
},
images: {
domains: ['a.storyblok.com'],
},
i18n: {
locales: ['en', 'es', 'hi', 'fr', 'pt', 'de'],
defaultLocale: 'en',
localeDetection: true,
},
async redirects() {
return [
{
source: '/welcome',
destination: '/courses',
permanent: false,
},
{
source: '/login',
destination: '/courses',
permanent: false,
},
{
source: '/partnership/:path*',
destination: '/welcome/:path*',
permanent: true,
},
{
source: '/chat',
destination: '/messaging',
permanent: true,
},
];
},
async rewrites() {
return [
{
source: '/welcome/(b|B)(a|A)(d|D)(o|O)(o|O)',
destination: '/welcome/badoo',
},
{
source: '/welcome/(b|B)(u|U)(m|M)(b|B)(l|L)(e|E)',
destination: '/welcome/bumble',
},
{
source: '/welcome/(f|F)(r|R)(u|U)(i|I)(t|T)(z|Z)',
destination: '/welcome/fruitz',
},
];
},
}),
);