-
Notifications
You must be signed in to change notification settings - Fork 825
Expand file tree
/
Copy pathnext.config.js
More file actions
51 lines (47 loc) · 1.24 KB
/
Copy pathnext.config.js
File metadata and controls
51 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const path = require("path");
// Load the .env file for local development
// .env.development.local by default
require("dotenv").config({
path: path.resolve(process.cwd(), ".env.development.local"),
});
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: "standalone",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "cdn.bfldr.com",
pathname: "/MEM5087K/**",
},
],
},
async headers() {
return [
{
// Match _next/static files (JS chunks, CSS, etc)
source: "/_next/static/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, must-revalidate",
},
],
},
];
},
generateBuildId: async () => {
// Generate a unique build ID each time to ensure fresh chunk names
return `build-${Date.now()}`;
},
webpack: (config, { buildId }) => {
// Use buildId as hash salt so chunk filenames change with each build
config.output.hashSalt = buildId;
return config;
},
};
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer(nextConfig);