-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
42 lines (37 loc) · 1.37 KB
/
next.config.mjs
File metadata and controls
42 lines (37 loc) · 1.37 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
// next.config.js
import bundleAnalyzer from '@next/bundle-analyzer';
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
export default withBundleAnalyzer({
reactStrictMode: false,
eslint: { ignoreDuringBuilds: true },
experimental: { optimizePackageImports: ['@mantine/core', '@mantine/hooks'] },
async headers() {
return [
{
// be flexible: allow all nested paths under /tiles
source: '/tiles/:path*',
headers: [
// let the platform decide on compression; do NOT set Content-Encoding
{ key: 'Content-Type', value: 'application/vnd.mapbox-vector-tile' },
{
key: 'Cache-Control',
value: 'public, max-age=31536000, immutable',
},
// CORS
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET, OPTIONS' },
{
key: 'Access-Control-Allow-Headers',
value: 'Origin, Range, Content-Type, Accept, Accept-Encoding',
},
// ensure correct variant caching when brotli/gzip is applied by the host
{ key: 'Vary', value: 'Accept-Encoding' },
// optional but sometimes helpful with strict COOP/CORP setups
// { key: 'Cross-Origin-Resource-Policy', value: 'cross-origin' },
],
},
];
},
});