-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathnext.config.js
More file actions
98 lines (95 loc) · 2.71 KB
/
Copy pathnext.config.js
File metadata and controls
98 lines (95 loc) · 2.71 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
/** @type {import('next').NextConfig} */
const path = require("path");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
const nextConfig = withBundleAnalyzer({
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
},
typescript: {
// Type checking is handled and flagged by CI (GitHub Actions).
// Skipping here to reduce Vercel build time and memory usage.
ignoreBuildErrors: true,
},
eslint: {
// Linting is handled and flagged by CI (GitHub Actions).
// Skipping here to reduce Vercel build time and memory usage.
ignoreDuringBuilds: true,
},
async redirects() {
return [];
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "X-XSS-Protection",
value: "1; mode=block",
},
],
},
];
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "cdn4.iconfinder.com",
},
{
protocol: "https",
hostname: "cdn3.iconfinder.com",
},
{
protocol: "https",
hostname: "i.pinimg.com",
},
{
protocol: "https",
hostname: "content.optimism.io",
},
],
dangerouslyAllowSVG: false,
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
webpack: (config) => {
config.resolve.fallback = { fs: false, net: false, tls: false };
config.resolve.alias = config.resolve.alias || {};
config.resolve.alias["react-infinite-scroller$"] = path.resolve(
__dirname,
"src/lib/shims/InfiniteScroll.tsx"
);
config.resolve.alias["swagger-ui-react$"] = path.resolve(
__dirname,
"src/lib/shims/SwaggerUI.tsx"
);
// Point the shim at the real package's resolved entry so its internal
// require() does not match the exact-match alias above and recurse into
// the shim itself (which would yield an incomplete module object).
config.resolve.alias["swagger-ui-react-impl$"] =
require.resolve("swagger-ui-react");
config.resolve.alias["@react-native-async-storage/async-storage$"] =
path.resolve(__dirname, "src/lib/shims/asyncStorage.ts");
return config;
},
// Necessary to prevent github.com/open-telemetry/opentelemetry-js/issues/4297
serverExternalPackages: ["@opentelemetry/sdk-node"],
experimental: {
serverActions: {
bodySizeLimit: "10mb",
},
},
output: "standalone", // Optional, good for Docker
});
module.exports = nextConfig;