-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
71 lines (68 loc) · 1.83 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
const { i18n } = require('./next-i18next.config')
const nextConfig = {
poweredByHeader: false,
reactStrictMode: true,
swcMinify: true,
cleanDistDir: false,
i18n,
publicRuntimeConfig: {
isTest: process.env.IS_TEST || 0,
},
env: {
COMPANY_ID: process.env.COMPANY_ID,
API_URL: process.env.API_URL,
PK: process.env.PK,
ENCRYPT: process.env.ENCRYPT,
},
images: {
domains: ['cats2.oss-cn-hongkong.aliyuncs.com'],
},
async headers() {
return [
{
source: '/images/(.*).(jpg|png|ico)',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=900, immutable',
},
],
},
{
source: '/fonts/(.*).(woff2|eot|ttf|svg|css)',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable',
},
],
},
]
},
async rewrites() {
return [
{
source: '/api/:path*',
destination: process.env.API_URL + '/:path*',
},
// {
// source: '/api/cats-gateway/:path*',
// destination: process.env.API_URL + '/cats-gateway/:path*',
// },
]
},
webpack(config ) {
// @ts-ignore
config.resolve.alias = {
...config.resolve.alias,
'@': __dirname,
public: `${__dirname}/public/`,
}
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
}
return config
},
}
module.exports = nextConfig