-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
65 lines (59 loc) · 1.53 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
import nextTranslate from 'next-translate-plugin';
const NODE_ENV = process.env.NODE_ENV;
const isProd = NODE_ENV === 'production';
const isDev = NODE_ENV === 'development';
/**
* Next.js configuration options
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
async rewrites() {
// This is an example of how to proxy API requests to a different server.映射到其他服务器的API请求的例子
return [
{
source: '/api/:path*',
destination: isDev ? 'http://localhost:8000/api/:path*' : '/api/:path*',
},
{
source: '/docs',
destination: isDev ? 'http://127.0.0.1:8000/docs' : '/api/docs',
}, {
source: '/openapi.json',
destination: isDev ? 'http://127.0.0.1:8000/openapi.json' : '/api/openapi.json',
}
];
},
webpack: (config, { isServer, webpack }) => {
return config;
},
// async redirects() {
// return [
// {
// source: '/admin',
// destination: '/admin/dashboard',
// permanent: true,
// }
// ]
// },
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'utfs.io',
port: ''
},
{
protocol: 'https',
hostname: 'api.slingacademy.com',
port: ''
}
]
},
transpilePackages: ['geist']
// i18n: {
// locales: ['en', 'zh'],
// defaultLocale: 'zh',
// }
};
export default nextTranslate(nextConfig);