forked from Custos-Diretriz/Custos-Dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
56 lines (53 loc) · 1.24 KB
/
Copy pathnext.config.mjs
File metadata and controls
56 lines (53 loc) · 1.24 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
import withPWAInit from "@ducanh2912/next-pwa";
import { fileURLToPath } from "url";
import path from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const withPWA = withPWAInit({
dest: "public",
register: true,
disable: false,
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
workboxOptions: {
disableDevLogs: false,
},
});
export default withPWA({
// Your Next.js config
reactStrictMode: true,
images: {
domains: ["custosbackend.onrender.com"],
remotePatterns: [
{
protocol: "https",
hostname: "ipfs.io",
port: "",
pathname: "/ipfs/**",
},
{
protocol: "https",
hostname: "custosbackend.onrender.com",
port: "",
pathname: "/media/**",
},
],
},
webpack: (config, { dev, isServer }) => {
// Disable cache in development
if (dev) {
config.cache = false;
} else {
config.cache = {
type: "filesystem",
buildDependencies: {
config: [__filename],
},
cacheDirectory: path.resolve(__dirname, ".next/cache"),
maxAge: 5184000000, // 60 days
};
}
return config;
},
});