-
Notifications
You must be signed in to change notification settings - Fork 13
/
next.config.js
95 lines (92 loc) · 2.21 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'media.licdn.com', // LinkedIn profile images
pathname: '/dms/image/**',
},
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com', // Google profile images
pathname: '/**',
},
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com', // GitHub profile images
pathname: '/**',
},
{
protocol: 'https',
hostname: 'avatar-management--avatars.us-west-2.prod.public.atl-paas.net', // Bitbucket profile images
pathname: '/**',
},
{
protocol: 'https',
hostname: 'secure.gravatar.com', // Bitbucket profile images (additional)
pathname: '/**'
},
{
protocol: 'https',
hostname: 'gitlab.com', // GitLab profile images
pathname: '/uploads/-/system/user/avatar/**',
},
{
protocol: 'https',
hostname: process.env.NEXT_PUBLIC_STRAPI_API_URL, // Blog server
pathname: '/**',
},
{
protocol: 'https',
hostname: 'github.com', // GitHub README images
pathname: '/vibinex/.github/assets/**'
}
],
},
webpack: (config, { isServer }) => {
config.resolve.fallback = {
fs: false,
net: false,
dns: false,
tls: false,
'pg-native': false,
};
// Exclude pg-cloudflare from client-side bundles
if (!isServer) { config.externals.push('pg-cloudflare'); }
return config;
},
async headers() {
return [
{
// Apply these headers to all static assets
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{
key: "Access-Control-Allow-Methods",
value: "GET,OPTIONS,PATCH,DELETE,POST,PUT",
},
{
key: "Access-Control-Allow-Headers",
value:
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, Authorization",
},
],
}, {
source: "/(.*)",
headers: [{
key: "Cache-Control",
value: "max-age=86400, s-maxage=86400, stale-while-revalidate",
},
],
},
];
},
experimental: {
mdxRs: true,
},
};
const withMDX = require('@next/mdx')();
module.exports = withMDX(nextConfig);