-
Notifications
You must be signed in to change notification settings - Fork 118
/
next.config.js
89 lines (82 loc) · 1.77 KB
/
next.config.js
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
/** @type {import('next').NextConfig} */
/* eslint-disable @typescript-eslint/no-var-requires */
const { withAxiom } = require('next-axiom');
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
});
const nextConfig = {
eslint: {
dirs: ['.'],
},
poweredByHeader: false,
trailingSlash: true,
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
pathname: '**',
},
{
protocol: 'https',
hostname: '*.googleusercontent.com',
pathname: '**',
},
],
formats: ['image/avif', 'image/webp'],
},
experimental: {
optimizePackageImports: [
'@radix-ui/react-icons',
'flag-icons',
'@tiptap/core',
'react-select',
'posthog-js',
'posthog-js/react',
'lowlight',
'zod',
],
},
async headers() {
const headers = [];
headers.push({
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
],
});
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
headers.push({
source: '/:path*',
headers: [
{
key: 'X-Robots-Tag',
value: 'noindex',
},
],
});
}
return headers;
},
async rewrites() {
return [
{
source: '/ingest/static/:path*',
destination: 'https://us-assets.i.posthog.com/static/:path*',
},
{
source: '/ingest/:path*',
destination: 'https://us.i.posthog.com/:path*',
},
];
},
};
const combinedConfig = withAxiom(withPWA(nextConfig));
module.exports = combinedConfig;