-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
45 lines (38 loc) · 1.3 KB
/
Copy pathnext.config.mjs
File metadata and controls
45 lines (38 loc) · 1.3 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
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const projectRoot = dirname(fileURLToPath(import.meta.url));
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
outputFileTracingRoot: projectRoot,
turbopack: {
root: projectRoot,
},
serverExternalPackages: ['mysql2'],
// Give builds migrated from the retired custom JSX runtime a fresh compiler
// cache namespace without disabling persistent caching.
compiler: {
reactRemoveProperties: false,
},
// Disable x-powered-by header
poweredByHeader: false,
// Security headers
async headers() {
return [
{
source: '/:path*',
headers: [
{ key: 'X-DNS-Prefetch-Control', value: 'off' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'X-XSS-Protection', value: '0' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=(), payment=()' },
{ key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
{ key: 'Cross-Origin-Resource-Policy', value: 'same-site' },
],
},
];
},
};
export default nextConfig;