-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
75 lines (65 loc) · 1.7 KB
/
next.config.ts
File metadata and controls
75 lines (65 loc) · 1.7 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Optimize images
images: {
formats: ['image/webp', 'image/avif'],
remotePatterns: [
{
protocol: 'https',
hostname: 'images.unsplash.com',
port: '',
pathname: '/**',
},
],
},
// Experimental features for better performance
experimental: {
optimizePackageImports: ['lucide-react', '@radix-ui/react-slot'],
},
// Webpack optimizations
webpack: (config, { isServer, dev }) => {
// Fix for MetaMask SDK warning about React Native async storage
config.resolve.fallback = {
...config.resolve.fallback,
'@react-native-async-storage/async-storage': false,
};
// Optimize bundle splitting
if (!isServer) {
config.optimization.splitChunks.chunks = 'all';
config.optimization.splitChunks.cacheGroups = {
...config.optimization.splitChunks.cacheGroups,
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
};
}
// Enable faster compilation in development
if (dev) {
config.devtool = 'eval-source-map';
config.optimization = {
...config.optimization,
minimize: false,
moduleIds: 'named',
chunkIds: 'named',
};
}
return config;
},
// TypeScript configuration
typescript: {
ignoreBuildErrors: true,
},
// ESLint configuration
eslint: {
ignoreDuringBuilds: true,
},
// Development optimizations
onDemandEntries: {
// Keep pages in memory for faster navigation
maxInactiveAge: 60 * 1000, // 60 seconds
pagesBufferLength: 5,
},
};
export default nextConfig;