scoresaber-reloaded-v2/next.config.js

58 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-10-20 10:54:20 +00:00
const nextBuildId = require("next-build-id");
2023-11-13 05:42:06 +00:00
const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: false });
// Define remote patterns for images
const remotePatterns = [
{ protocol: "https", hostname: "cdn.fascinated.cc", pathname: "/**" },
{ protocol: "https", hostname: "cdn.scoresaber.com", pathname: "/**" },
{ protocol: "https", hostname: "cdn.jsdelivr.net", pathname: "/**" },
{ protocol: "https", hostname: "eu.cdn.beatsaver.com", pathname: "/**" },
{ protocol: "https", hostname: "na.cdn.beatsaver.com", pathname: "/**" },
{
protocol: "https",
hostname: "avatars.akamai.steamstatic.com",
pathname: "/**",
},
];
// Define optimized package imports
const optimizePackageImports = [
"react",
"react-dom",
"next-themes",
"react-tostify",
"websocket",
"cslx",
"chart.js",
"react-chartjs-2",
"country-list",
"@sentry/nextjs",
];
2023-10-20 10:54:20 +00:00
2023-10-18 06:58:40 +00:00
/** @type {import('next').NextConfig} */
2023-10-19 04:21:35 +00:00
const nextConfig = {
2023-10-19 13:17:55 +00:00
generateEtags: true,
2023-11-08 11:49:19 +00:00
reactStrictMode: true,
swcMinify: true,
2023-11-13 05:42:06 +00:00
compress: false,
poweredByHeader: false,
2023-11-08 11:49:19 +00:00
experimental: {
webpackBuildWorker: true,
2023-11-13 05:42:06 +00:00
optimizePackageImports,
2023-11-08 11:49:19 +00:00
},
2023-10-20 10:54:20 +00:00
env: {
2023-10-20 11:00:41 +00:00
NEXT_PUBLIC_BUILD_ID:
process.env.GIT_REV || nextBuildId.sync({ dir: __dirname }),
2023-11-06 17:40:54 +00:00
NEXT_PUBLIC_BUILD_TIME: new Date().toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
}),
2023-10-20 10:54:20 +00:00
},
2023-11-13 05:42:06 +00:00
images: { remotePatterns },
2023-10-19 04:21:35 +00:00
};
2023-10-18 06:58:40 +00:00
2024-02-01 01:45:07 +00:00
module.exports = withBundleAnalyzer(nextConfig);