-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
38 lines (35 loc) · 1.02 KB
/
next.config.js
File metadata and controls
38 lines (35 loc) · 1.02 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
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
/** @type {import('next').NextConfig} */
const nextConfig = {
// Required for pdf-parse to work in Next.js/Vercel serverless environment
serverExternalPackages: ["pdf-parse", "@napi-rs/canvas"],
async headers() {
return [
{
// Match all .gif, .png, .jpg, .mp4 files
source: "/:all*\\.(gif|png|jpg|mp4|ttf)$",
headers: [
{
key: "Cache-Control",
// Cache for 1 year, immutable for versioned assets
value: "public, max-age=31536000, immutable",
},
],
},
];
},
// Performance optimizations
compiler: {
removeConsole: process.env.NODE_ENV === 'production' ? {
exclude: ['error', 'warn'],
} : false,
},
// Optimize package imports
experimental: {
optimizePackageImports: ['react-konva', 'konva', 'motion'],
},
};
export default withBundleAnalyzer(nextConfig);