forked from solana-foundation/explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
52 lines (48 loc) · 1.93 KB
/
Copy pathnext.config.mjs
File metadata and controls
52 lines (48 loc) · 1.93 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
import { withSentryConfig } from '@sentry/nextjs';
import { withBotId } from 'botid/next/config';
import { fileURLToPath } from 'url';
import { buildRedirects } from './config/redirects.mjs';
import { createSentryBuildConfig } from './sentry/config.mjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
// Use separate build directory for dev server to avoid conflicts with production builds
distDir: process.env.NODE_ENV === 'production' ? '.next' : '.next-dev',
images: {
remotePatterns: [
{
hostname: 'raw.githubusercontent.com',
pathname: '/solana-labs/token-list/main/assets/**',
port: '',
protocol: 'https',
},
],
},
async headers() {
const seoFileHeaders = [
{
key: 'Cache-Control',
value: 'public, max-age=3600, stale-while-revalidate=86400',
},
];
return [
{ source: '/robots.txt', headers: seoFileHeaders },
{ source: '/sitemap.xml', headers: seoFileHeaders },
{ source: '/default-sitemap.xml', headers: seoFileHeaders },
{ source: '/accounts-sitemap.xml', headers: seoFileHeaders },
];
},
async redirects() {
return buildRedirects();
},
turbopack: {
// Pin to project root; otherwise Turbopack walks up to a parent pnpm-workspace.yaml (e.g. in git worktrees).
root: fileURLToPath(new URL('.', import.meta.url)),
resolveAlias: {
// resolve-domain.ts uses deserializeUnchecked, removed in borsh@2 (also installed as borsh2).
borsh: './node_modules/borsh',
// @coral-xyz/anchor's nodewallet/workspace require('fs'), but those paths never run in the browser.
fs: { browser: './empty.ts' },
},
},
};
export default withBotId(withSentryConfig(nextConfig, createSentryBuildConfig()));