-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
72 lines (69 loc) · 1.83 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
63
64
65
66
67
68
69
70
71
72
/** @type {import('next').NextConfig} */
import withPWA from 'next-pwa';
const nextConfig = {
reactStrictMode: false,
async rewrites() {
return [
{
source: '/api/:path*',
destination: `${process.env.NEXT_PUBLIC_AUTH_URL}/:path*`,
},
{
source: '/api/callback/apple',
destination: '/api/callback/apple',
},
];
},
...withPWA({
dest: 'public',
register: true,
skipWaiting: true,
}),
webpack: (config, { isServer }) => {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
if (isServer) {
// next server build => ignore msw/browser
if (Array.isArray(config.resolve.alias)) {
// in Next the type is always object, so this branch isn't necessary. But to keep TS happy, avoid @ts-ignore and prevent possible future breaking changes it's good to have it
config.resolve.alias.push({ name: 'msw/browser', alias: false });
} else {
config.resolve.alias['msw/browser'] = false;
}
} else {
// browser => ignore msw/node
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: 'msw/node', alias: false });
} else {
config.resolve.alias['msw/node'] = false;
}
}
return config;
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'healthy-bucket-s3.s3.ap-northeast-2.amazonaws.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'to-be-healthy-bucket.s3.ap-northeast-2.amazonaws.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'cdn.to-be-healthy.site',
port: '',
pathname: '/**',
},
],
dangerouslyAllowSVG: true,
},
};
export default nextConfig;