forked from zhpd/chatgpt-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
46 lines (44 loc) · 1.01 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
/** @type {import('next').NextConfig} */
const { i18n } = require('./next-i18next.config')
const nextConfig = {
reactStrictMode: false,
// distDir: 'dist', // 静态化
output: 'standalone',
trailingSlash: true,
async rewrites() {
return {
fallback: [
{
source: '/api/:path*',
destination: `http://localhost:3002/api/:path*`,
},
],
}
},
i18n: {
...i18n,
localeDetection: false,
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'http',
hostname: '**',
},
],
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
issuer: /\.[jt]sx?$/,
resourceQuery: { not: /url/ }, // exclude if *.svg?url
use: ['@svgr/webpack'],
}) // 针对 SVG 的处理规则
return config
},
}
module.exports = nextConfig