-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.mjs
More file actions
67 lines (66 loc) · 1.76 KB
/
next.config.mjs
File metadata and controls
67 lines (66 loc) · 1.76 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
/** @type {import('next').NextConfig} */
const nextConfig = {
// ESLint configuration should live in your ESLint config (e.g. .eslintrc.json)
typescript: {
ignoreBuildErrors: false,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'image.moltly.xyz',
},
{
protocol: 'http',
hostname: 'localhost',
},
{
protocol: 'http',
hostname: '127.0.0.1',
},
],
// Allow unoptimized images for data URLs
unoptimized: false,
},
async headers() {
return [
// Strong caching for static uploads served from `public/uploads`
{
source: '/uploads/:path*',
headers: [
{ key: 'Cache-Control', value: 'public, max-age=31536000, immutable' },
],
},
{
source: '/.well-known/apple-app-site-association',
headers: [
{ key: 'Content-Type', value: 'application/json' },
{ key: 'Cache-Control', value: 'public, max-age=3600' },
],
},
{
source: '/.well-known/apple-developer-domain-association.txt',
headers: [
{ key: 'Content-Type', value: 'text/plain; charset=utf-8' },
{ key: 'Cache-Control', value: 'public, max-age=3600' },
],
},
// PWA assets
{
source: '/manifest.webmanifest',
headers: [
{ key: 'Content-Type', value: 'application/manifest+json; charset=utf-8' },
{ key: 'Cache-Control', value: 'public, max-age=3600' },
],
},
{
source: '/sw.js',
headers: [
// Encourage the browser to revalidate the SW file for updates
{ key: 'Cache-Control', value: 'no-cache' },
],
},
];
},
};
export default nextConfig;