-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
69 lines (63 loc) · 2.15 KB
/
next.config.js
File metadata and controls
69 lines (63 loc) · 2.15 KB
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
const withBundleAnalyzer=require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE==='true',
});
const withMDX=require('@next/mdx')({});
const jredirects=require('./jredirects/dist');
const { withPlausibleProxy }=require('next-plausible');
/** @type {import('next').NextConfig} */
const nextConfig={
redirects: jredirects,
transpilePackages: [
'@mui/material',
'@ant-design/icons',
'@ant-design/icons-svg',
"rc-util"
],
images: {
unoptimized: true, //comment out this line to export as HTML
remotePatterns: [
{
protocol: 'https',
hostname: 'i.ytimg.com',
pathname: '/vi/**',
}
]
},
async headers() {
return [
{
source: '/api/contact',
headers: CORSHeaders('https://shirtocracy.com', 'POST')
},
{
source: '/api/lirong-art-email-list/add',
headers: CORSHeaders()
},
{
source: '/api/log-event/rick-roll',
headers: CORSHeaders()
},
{
source: '/api/log-error/joelgreyson.com',
headers: CORSHeaders('https://joelgreyson.com')
},
{
source: '/api/page-visits/get-and-add',
headers: CORSHeaders('https://ad.joelgrayson.com')
}
];
function CORSHeaders(origin='*', methods='GET, POST, PUT, PATCH, OPTIONS') {
return [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: origin }, //the origin
{ key: "Access-Control-Allow-Methods", value: methods },
{ key: "Access-Control-Allow-Headers", value: "Content-Type, Authorization, X-Requested-With" },
];
}
},
// Uncomment below in order to export as HTML
// output: 'export',
// basePath: '/joelgrayson.com',
// assetPath: '/joelgrayson.com',
};
module.exports=withBundleAnalyzer(withMDX(withPlausibleProxy()(nextConfig)));