35 lines
905 B
TypeScript
35 lines
905 B
TypeScript
import type { NextConfig } from "next";
|
|
import bundleAnalyzer from '@next/bundle-analyzer';
|
|
|
|
const withBundleAnalyzer = bundleAnalyzer({
|
|
enabled: process.env.ANALYZE === 'true',
|
|
});
|
|
|
|
const nextConfig: NextConfig = {
|
|
experimental: {
|
|
optimizeCss: true,
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: 'images.unsplash.com' },
|
|
{ protocol: 'https', hostname: 'placehold.co' },
|
|
{ protocol: 'http', hostname: 'localhost' },
|
|
],
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/(.*)',
|
|
headers: [
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
{ key: 'X-XSS-Protection', value: '1; mode=block' },
|
|
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withBundleAnalyzer(nextConfig);
|