mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
- Add AVIF and WebP image formats for optimized delivery - Configure cache headers for static assets (images, icons, SVGs) - Enable server minification and optimize package imports - Disable poweredByHeader and enable compression - Remove unused radix-ui dependency
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
images: {
|
|
remotePatterns: [
|
|
{ protocol: 'https', hostname: 'img.youtube.com' },
|
|
{ protocol: 'https', hostname: 'i.ytimg.com' },
|
|
{ protocol: 'https', hostname: 'i.vimeocdn.com' },
|
|
{ protocol: 'https', hostname: 'vumbnail.com' },
|
|
{ protocol: 'https', hostname: 'images.unsplash.com' },
|
|
],
|
|
formats: ['image/avif', 'image/webp'],
|
|
},
|
|
experimental: {
|
|
optimizePackageImports: ['lucide-react', 'radix-ui'],
|
|
serverMinification: true,
|
|
},
|
|
poweredByHeader: false,
|
|
compress: true,
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/_next/static/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=31536000, immutable',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/images/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=2592000',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/:path*.ico',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=604800',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/:path*.svg',
|
|
headers: [
|
|
{
|
|
key: 'Cache-Control',
|
|
value: 'public, max-age=2592000',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|