-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
107 lines (96 loc) · 2.8 KB
/
next.config.js
File metadata and controls
107 lines (96 loc) · 2.8 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
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
const isProduction = process.env.NODE_ENV === 'production';
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
typescript: {
ignoreBuildErrors: false,
},
reactStrictMode: true,
poweredByHeader: false,
trailingSlash: false,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '*.aethelred.io',
},
{
protocol: 'https',
hostname: 'avatars.githubusercontent.com',
},
],
formats: ['image/avif', 'image/webp'],
},
async headers() {
return [
{
source: '/(.*)',
headers: [
{ key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
{ 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=(self), microphone=(), geolocation=(), interest-cohort=()' },
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
isProduction
? "script-src 'self' 'unsafe-inline'"
: "script-src 'self' 'unsafe-eval' 'unsafe-inline'",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: blob: https:",
"font-src 'self' data:",
"connect-src 'self' wss: https:",
"base-uri 'self'",
"object-src 'none'",
"form-action 'self'",
"frame-ancestors 'none'",
].join('; '),
},
],
},
];
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.alias = {
...config.resolve.alias,
'@react-native-async-storage/async-storage': false,
'pino-pretty': false,
};
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false,
crypto: false,
stream: false,
path: false,
os: false,
};
const webpack = require('webpack');
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => {
resource.request = resource.request.replace(/^node:/, '');
}),
);
}
// WASM support for ZK proof verification
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
layers: true,
};
config.module.rules.push({
test: /\.wasm$/,
type: 'webassembly/async',
});
return config;
},
experimental: {
optimizePackageImports: ['lucide-react', 'recharts', 'framer-motion'],
},
};
module.exports = nextConfig;