forked from zhpd/chatgpt-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
42 lines (40 loc) · 996 Bytes
/
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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
// distDir: 'dist', // 静态化
output: 'standalone',
trailingSlash: true,
transpilePackages: ['antd'],
async rewrites() {
return {
fallback: [
{
source: '/api/:path*',
destination: `${process.env.NEXT_PUBLIC_API_URL || ''}/api/:path*`, // Proxy to Backend
},
],
}
},
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