albert.lol/next.config.mjs
2024-01-09 19:42:44 +01:00

64 lines
1.1 KiB
JavaScript

import million from 'million/compiler'
const securityHeaders = [
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin',
},
{
key: 'Content-Security-Policy',
value: `frame-ancestors 'self';`,
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains; preload',
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=()',
},
]
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
source: '/:path*',
headers: securityHeaders,
},
]
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'i.scdn.co',
},
],
},
reactStrictMode: true,
swcMinify: true,
}
const millionConfig = {
auto: true,
}
export default million.next(nextConfig, millionConfig)