-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathnext.config.ts
More file actions
115 lines (113 loc) · 2.55 KB
/
next.config.ts
File metadata and controls
115 lines (113 loc) · 2.55 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import type { NextConfig } from "next";
import withPWA from "next-pwa";
const nextConfig: NextConfig = {
turbopack: {}, // Silence Turbopack warning for webpack-based next-pwa
experimental: {
serverActions: {
bodySizeLimit: '5mb',
},
},
async redirects() {
return [
{
source: "/code-analyzer",
destination: "/ai-code-review-tool",
permanent: true,
},
{
source: "/repo-analyzer",
destination: "/github-repository-analysis",
permanent: true,
},
{
source: "/architecture-analyzer",
destination: "/github-repository-analysis",
permanent: true,
},
];
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
},
{
protocol: 'https',
hostname: 'github.com',
},
{
protocol: 'https',
hostname: 'i.pravatar.cc',
},
{
protocol: 'https',
hostname: 'img.shields.io',
},
{
protocol: 'https',
hostname: 'public.blob.vercel-storage.com',
},
{
protocol: 'https',
hostname: '*.public.blob.vercel-storage.com',
},
],
},
};
export default withPWA({
dest: 'public',
register: true,
skipWaiting: true,
disable: false, // Enable in dev for testing
fallbacks: {
document: '/_offline.html',
},
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.(?:gstatic|googleapis)\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts',
expiration: {
maxEntries: 4,
maxAgeSeconds: 365 * 24 * 60 * 60, // 1 year
},
},
},
{
urlPattern: /^https:\/\/api\.github\.com\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'github-api',
networkTimeoutSeconds: 10,
expiration: {
maxEntries: 50,
maxAgeSeconds: 5 * 60, // 5 minutes
},
},
},
{
urlPattern: /\.(?:png|jpg|jpeg|svg|gif|webp|ico)$/i,
handler: 'CacheFirst',
options: {
cacheName: 'static-images',
expiration: {
maxEntries: 60,
maxAgeSeconds: 30 * 24 * 60 * 60, // 30 days
},
},
},
{
urlPattern: /\.(?:js|css)$/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'static-resources',
expiration: {
maxEntries: 100,
maxAgeSeconds: 24 * 60 * 60, // 24 hours
},
},
},
],
})(nextConfig);