2023-09-05 20:06:59 +07:00
|
|
|
const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
|
|
|
|
enabled: process.env.ANALYZE === "true",
|
|
|
|
|
});
|
|
|
|
|
module.exports = withBundleAnalyzer({
|
|
|
|
|
// your Next.js configuration
|
2024-04-19 19:21:34 +07:00
|
|
|
images: {
|
2025-07-30 17:32:50 +07:00
|
|
|
remotePatterns: [
|
|
|
|
|
{
|
|
|
|
|
protocol: "https",
|
|
|
|
|
hostname: "i.scdn.co",
|
|
|
|
|
},
|
|
|
|
|
],
|
2025-03-18 12:39:32 +07:00
|
|
|
// Add image optimization settings
|
2025-07-30 17:32:50 +07:00
|
|
|
formats: ["image/avif", "image/webp"],
|
2025-03-18 12:39:32 +07:00
|
|
|
minimumCacheTTL: 60,
|
2024-04-19 19:21:34 +07:00
|
|
|
},
|
2024-02-12 18:51:36 +07:00
|
|
|
webpack: (config, options) => {
|
|
|
|
|
config.module.rules.push({
|
|
|
|
|
test: /\.pdf$/i,
|
|
|
|
|
type: "asset/source",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
},
|
2023-09-06 22:05:49 +07:00
|
|
|
async headers() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
source: "/sitemap.xml.gz",
|
|
|
|
|
headers: [
|
|
|
|
|
{
|
|
|
|
|
key: "Content-Type",
|
|
|
|
|
value: "application/gzip",
|
|
|
|
|
},
|
2025-03-18 12:39:32 +07:00
|
|
|
{
|
|
|
|
|
key: "Cache-Control",
|
|
|
|
|
value: "public, max-age=3600", // Cache for 1 hour
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-07-30 17:32:50 +07:00
|
|
|
source: "/:path*",
|
2025-03-18 12:39:32 +07:00
|
|
|
headers: [
|
|
|
|
|
{
|
2025-07-30 17:32:50 +07:00
|
|
|
key: "X-Content-Type-Options",
|
|
|
|
|
value: "nosniff",
|
2025-03-18 12:39:32 +07:00
|
|
|
},
|
|
|
|
|
{
|
2025-07-30 17:32:50 +07:00
|
|
|
key: "X-Frame-Options",
|
|
|
|
|
value: "DENY",
|
2025-03-18 12:39:32 +07:00
|
|
|
},
|
|
|
|
|
{
|
2025-07-30 17:32:50 +07:00
|
|
|
key: "X-XSS-Protection",
|
|
|
|
|
value: "1; mode=block",
|
2025-03-18 12:39:32 +07:00
|
|
|
},
|
2023-09-06 22:05:49 +07:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
2025-03-18 12:39:32 +07:00
|
|
|
// Add performance optimizations
|
|
|
|
|
reactStrictMode: true,
|
|
|
|
|
compiler: {
|
2025-07-30 17:32:50 +07:00
|
|
|
removeConsole:
|
|
|
|
|
process.env.NODE_ENV === "production"
|
|
|
|
|
? {
|
|
|
|
|
exclude: ["error", "warn"],
|
|
|
|
|
}
|
|
|
|
|
: false,
|
2025-03-18 12:39:32 +07:00
|
|
|
},
|
2023-09-05 20:06:59 +07:00
|
|
|
});
|