-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
41 lines (40 loc) · 1.08 KB
/
next.config.js
File metadata and controls
41 lines (40 loc) · 1.08 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
const nextConfig = {
output: 'standalone',
images: {
unoptimized: true,
},
experimental: {
// Remove if not using Server Components
serverComponentsExternalPackages: ['mongodb'],
},
webpack(config, { dev }) {
if (dev) {
// Reduce CPU/memory from file watching
config.watchOptions = {
poll: 2000, // check every 2 seconds
aggregateTimeout: 300, // wait before rebuilding
ignored: ['**/node_modules'],
};
}
return config;
},
onDemandEntries: {
maxInactiveAge: 10000,
pagesBufferLength: 2,
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{ key: "X-Frame-Options", value: "ALLOWALL" },
{ key: "Content-Security-Policy", value: "frame-ancestors *;" },
{ key: "Access-Control-Allow-Origin", value: process.env.CORS_ORIGINS || "*" },
{ key: "Access-Control-Allow-Methods", value: "GET, POST, PUT, DELETE, OPTIONS" },
{ key: "Access-Control-Allow-Headers", value: "*" },
],
},
];
},
};
module.exports = nextConfig;