forked from deleon626/MIDAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
45 lines (42 loc) · 1.1 KB
/
next.config.mjs
File metadata and controls
45 lines (42 loc) · 1.1 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
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
domains: [],
remotePatterns: [],
},
// Enable more detailed error messages in development
webpack: (config, { dev, isServer }) => {
if (dev && !isServer) {
config.devtool = 'source-map';
}
// Optimize vendor chunks
if (!dev && !isServer) {
// Ensure framer-motion is properly chunked
config.optimization.splitChunks = {
chunks: 'all',
cacheGroups: {
default: false,
vendors: false,
// Vendor chunk for framer-motion
framerMotion: {
test: /[\\/]node_modules[\\/](framer-motion)[\\/]/,
name: 'vendor-framer-motion',
priority: 20,
chunks: 'all',
},
// Other vendor packages
vendor: {
name: 'vendor',
test: /[\\/]node_modules[\\/](?!framer-motion)/,
priority: 10,
chunks: 'all',
},
},
};
}
return config;
},
}
export default nextConfig