Create professional demos and 3D mockups in seconds, directly in your browser
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin("./i18n.ts");
const securityHeaders = [
{ key: "Cross-Origin-Opener-Policy", value: "same-origin" },
{ key: "Cross-Origin-Embedder-Policy", value: "unsafe-none" },
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{
key: "Permissions-Policy",
value: "camera=(self), microphone=(self), display-capture=(self)",
},
];
const nextConfig: NextConfig = {
poweredByHeader: false,
compress: true,
experimental: {
optimizePackageImports: [
"lucide-react",
"@iconify/react",
"framer-motion",
"gsap",
"three",
"@react-three/fiber",
"@react-three/drei",
"radix-ui",
"@radix-ui/react-dialog",
"@radix-ui/react-dropdown-menu",
"mediabunny",
"html-to-image",
"lenis",
],
},
images: {
formats: ["image/avif", "image/webp"],
remotePatterns: [
{
protocol: "https",
hostname: "images.unsplash.com",
pathname: "/**",
},
{ protocol: "https", hostname: "pixabay.com", pathname: "/**" },
{ protocol: "https", hostname: "cdn.pixabay.com", pathname: "/**" },
{ protocol: "https", hostname: "images.pexels.com", pathname: "/**" },
{ protocol: "https", hostname: "api.dicebear.com", pathname: "/**" },
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
pathname: "/**",
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
pathname: "/**",
},
{ protocol: "https", hostname: "static-cdn.jtvnw.net", pathname: "/**" },
],
},
headers: async () => [
{
source: "/images/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/svg/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/ffmpeg/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/models/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/hdri/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
{
source: "/videos/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=86400, stale-while-revalidate=604800",
},
],
},
{
source: "/site.webmanifest",
headers: [
{
key: "Cache-Control",
value: "public, max-age=86400, stale-while-revalidate=604800",
},
],
},
{
source: "/:locale(en|es|ru|ko)",
headers: [
...securityHeaders,
{
key: "Cache-Control",
value:
"public, s-maxage=300, stale-while-revalidate=86400",
},
],
},
{
source: "/:locale(en|es|ru|ko)/:path*",
headers: [
...securityHeaders,
{
key: "Cache-Control",
value:
"public, s-maxage=60, stale-while-revalidate=3600",
},
],
},
{
source: "/(.*)",
headers: securityHeaders,
},
],
};
export default withNextIntl(nextConfig);