-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathnext.config.mjs
82 lines (80 loc) · 2.22 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
73
74
75
76
77
78
79
80
81
82
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
compress: true,
optimizeFonts: true,
experimental: {
swcPlugins: [
[
'@lingui/swc-plugin', {}
]
]
},
trailingSlash: true,
webpack: (config, { webpack }) => {
config.module.rules.push({
test: /\/translations\/.*\/.*\.json$/,
use: {
loader: '@lingui/loader'
}
})
// 添加新的插件配置
config.plugins.push(
new webpack.IgnorePlugin({
resourceRegExp: /canvas|jsdom/,
contextRegExp: /konva/
})
)
return config
},
redirects() {
return [
{
source: '/:lang/blog',
destination: '/:lang/blogs',
permanent: true,
},
{
source: '/:lang/article',
destination: '/:lang/',
permanent: true,
},
{
source: '/:path*',
destination: '/',
permanent: true,
has: [
{
type: 'host',
value: '(.*)undefined(.*)',
},
],
},
];
},
env: {
UE_COS_SECRET_ID: process.env.UE_COS_SECRET_ID,
UE_COS_SECRET_KEY: process.env.UE_COS_SECRET_KEY,
UE_COS_REGION: process.env.UE_COS_REGION,
UE_COS_BUCKET: process.env.UE_COS_BUCKET,
UE_COS_PUBLIC_PATH: process.env.UE_COS_PUBLIC_PATH,
UE_PAYPAL_CLIENT_ID: process.env.UE_PAYPAL_CLIENT_ID,
UE_PAYPAL_CLIENT_SECRET: process.env.UE_PAYPAL_CLIENT_SECRET,
UE_STRIPE_PK: process.env.UE_STRIPE_PK,
UE_PROCESS_API_URL: process.env.UE_PROCESS_API_URL,
UE_S3_ACCESS_KEY: process.env.UE_S3_ACCESS_KEY,
UE_S3_SECRET_KEY: process.env.UE_S3_SECRET_KEY,
UE_S3_SESSION_TOKEN: process.env.UE_S3_SESSION_TOKEN,
UE_S3_ENDPOINT: process.env.UE_S3_ENDPOINT,
UE_S3_ACCOUNT_ID: process.env.UE_S3_ACCOUNT_ID,
UE_S3_REGION: process.env.UE_S3_REGION,
UE_S3_BUCKET: process.env.UE_S3_BUCKET,
UE_GOOGLE_CLIENT_ID:process.env.UE_GOOGLE_CLIENT_ID,
UE_GOOGLE_CLIENT_SECRET:process.env.UE_GOOGLE_CLIENT_SECRET,
UE_WEB_API_URL:process.env.UE_WEB_API_URL,
UE_S3_PUBLIC_PATH:process.env.UE_S3_PUBLIC_PATH,
UE_MQ_API_URL:process.env.UE_MQ_API_URL,
AUTH_SECRET:process.env.AUTH_SECRET
}
}
export default nextConfig