forked from SolDevCn/old-earn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
105 lines (98 loc) · 2.29 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/** @type {import('next').NextConfig} */
/* eslint-disable @typescript-eslint/no-var-requires */
const { withAxiom } = require('next-axiom');
const { withSentryConfig } = require('@sentry/nextjs');
const { i18n } = require('./next-i18next.config');
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
});
const nextConfig = {
typescript: {
// https://nextjs.org/docs/app/api-reference/next-config-js/typescript
ignoreBuildErrors: true,
},
eslint: {
dirs: ['.'],
ignoreDuringBuilds: true,
},
poweredByHeader: false,
trailingSlash: true,
reactStrictMode: true,
swcMinify: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
pathname: '**',
},
],
formats: ['image/avif', 'image/webp'],
},
transpilePackages: ['@premieroctet/next-admin'],
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*',
},
];
},
experimental: {
swcPlugins: [
[
'next-superjson-plugin',
{
excluded: [],
},
],
],
},
};
const combinedConfig = withAxiom(withPWA(nextConfig));
module.exports = withSentryConfig(combinedConfig, {
i18n,
org: 'superteam-7o',
project: 'earn',
silent: true,
tunnelRoute: '/monitoring',
hideSourceMaps: true,
disableLogger: true,
autoInstrumentServerFunctions: false,
autoInstrumentMiddleware: false,
env: {
NEXT_PUBLIC_EARN_GOD_EMAIL: process.env.NEXT_PUBLIC_EARN_GOD_EMAIL,
NEXT_PUBLIC_EARN_GOD_TELEGRAM: process.env.NEXT_PUBLIC_EARN_GOD_TELEGRAM,
},
});