-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
64 lines (59 loc) · 1.43 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
const isProd = process.env.NODE_ENV === 'production';
const withPWA = require('next-pwa')({
dest: 'public',
disable: !isProd,
});
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
const API_URL = process.env.API_URL;
return [
{
source: '/@:userHandle',
destination: '/users/:userHandle',
},
{
source: '/@:userHandle/followers',
destination: '/users/:userHandle/followers',
},
{
source: '/@:userHandle/following',
destination: '/users/:userHandle/following',
},
{
source: '/@:userHandle/select-category',
destination: '/users/:userHandle/select-category',
},
{
source: '/@:userHandle/:articleId/:path*',
destination: '/users/:userHandle/articles/:articleId/:path*',
},
{
source: '/backend-api/:path*',
destination: `${API_URL}/:path*`,
},
];
},
images: {
remotePatterns: [
/* s3 bucket */
{
protocol: 'https',
hostname: 's3.ap-northeast-2.amazonaws.com',
},
/* cloudfront - development, production */
{
protocol: 'https',
hostname: 'd60yoiev654ed.cloudfront.net',
},
],
},
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/i,
use: ['@svgr/webpack'],
});
return config;
},
};
module.exports = withPWA(nextConfig); // ?