-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
131 lines (115 loc) · 4.06 KB
/
next.config.mjs
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
poweredByHeader: false,
// Allow build to proceed even if there are errors
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
env: {
NEXT_PUBLIC_SUPABASE_URL: process.env.NEXT_PUBLIC_SUPABASE_URL,
NEXT_PUBLIC_SUPABASE_ANON_KEY: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
NEXT_PUBLIC_MAILCHIMP_API_KEY: process.env.NEXT_PUBLIC_MAILCHIMP_API_KEY,
NEXT_PUBLIC_MAILCHIMP_AUDIENCE_ID: process.env.NEXT_PUBLIC_MAILCHIMP_AUDIENCE_ID,
NEXT_PUBLIC_MAILCHIMP_DATA_CENTER: process.env.NEXT_PUBLIC_MAILCHIMP_DATA_CENTER,
},
serverRuntimeConfig: {
POSTGRES_URL: process.env.POSTGRES_URL,
BASE_URL: process.env.BASE_URL,
AUTH_SECRET: process.env.AUTH_SECRET,
SOLANA_NETWORK: process.env.SOLANA_NETWORK,
SOLANA_MAINNET_RPC: process.env.SOLANA_MAINNET_RPC,
TOKEN_PROGRAM_ID: process.env.TOKEN_PROGRAM_ID,
TOKEN_METADATA_PROGRAM_ID: process.env.TOKEN_METADATA_PROGRAM_ID,
HELIUS_API_URL: process.env.HELIUS_API_URL,
HELIUS_API_KEY: process.env.HELIUS_API_KEY,
SHYFT_API_URL: process.env.SHYFT_API_URL,
SHYFT_API_KEY: process.env.SHYFT_API_KEY,
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,
ACCESS_KEY_ID: process.env.ACCESS_KEY_ID,
ACCESS_KEY_PASSWORD: process.env.ACCESS_KEY_PASSWORD,
JWT_SECRET: process.env.JWT_SECRET,
},
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'uploadcare.com' },
{ protocol: 'https', hostname: 'ucarecdn.com' },
{ protocol: 'https', hostname: 'unsplash.com' },
{ protocol: 'https', hostname: '**.public.blob.vercel-storage.com' },
{ protocol: 'https', hostname: 'res.cloudinary.com' },
{ protocol: 'https', hostname: 'imgur.com' },
{ protocol: 'https', hostname: 'i.imgur.com' },
],
},
productionBrowserSourceMaps: true,
experimental: {
optimizeCss: true,
optimizePackageImports: ['@mui/material', '@mui/icons-material', 'lodash'],
serverActions: true,
},
webpack: (config, { dev, isServer }) => {
if (!dev && !isServer) {
config.optimization.splitChunks.cacheGroups.styles = {
name: 'styles',
test: /\.(css|scss)$/,
chunks: 'all',
enforce: true,
};
}
config.experiments = { ...config.experiments, asyncWebAssembly: true };
config.module.rules.push({
test: /\.(png|jpe?g|gif|svg|webp)$/i,
use: [
{
loader: 'image-webpack-loader',
options: {
mozjpeg: { progressive: true, quality: 65 },
optipng: { enabled: !dev },
pngquant: { quality: [0.65, 0.90], speed: 4 },
gifsicle: { interlaced: false },
webp: { quality: 75 },
},
},
],
});
return config;
},
headers: async () => [
{
source: '/(.*)',
headers: [
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
{ key: 'Content-Security-Policy', value: "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:;" },
],
},
],
redirects: async () => [
{
source: '/home',
destination: '/',
permanent: true,
},
],
rewrites: async () => [
{
source: '/api/v1/:path*',
destination: 'https://api.barkprotocol.net/:path*',
},
],
};
export default nextConfig;