-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
65 lines (63 loc) · 1.62 KB
/
next.config.ts
File metadata and controls
65 lines (63 loc) · 1.62 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
import type { NextConfig } from "next";
import withPWA from "next-pwa";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{ protocol: "https", hostname: "fakestoreapi.com" },
{ protocol: "https", hostname: "cdn.dummyjson.com" },
{ protocol: "https", hostname: "images.pexels.com" },
{ protocol: "https", hostname: "res.cloudinary.com" },
],
},
typescript: {
// ✅ Allow builds even if there are TS errors
ignoreBuildErrors: true,
},
eslint: {
// ✅ Optional: ignore ESLint errors during build (for Render/Vercel)
ignoreDuringBuilds: true,
},
async rewrites() {
return [
{
source: "/api/proxy/:path*",
destination: `${process.env.NEXT_PUBLIC_BASE_ROUTE}/:path*`,
},
];
},
};
export default withPWA({
dest: "public",
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === "development",
fallbacks: {
document: "/Offline",
},
runtimeCaching: [
{
urlPattern: ({ request }: { request: Request }) => request.mode === "navigate",
handler: "NetworkFirst",
options: {
cacheName: "pages-cache",
expiration: { maxEntries: 50 },
},
},
{
urlPattern: /\.(?:js|css|png|jpg|jpeg|svg|webp|ico)$/i,
handler: "StaleWhileRevalidate",
options: {
cacheName: "static-assets",
expiration: { maxEntries: 100 },
},
},
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",
options: {
cacheName: "api-cache",
expiration: { maxEntries: 50, maxAgeSeconds: 24 * 60 * 60 },
},
},
],
})(nextConfig);