-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
76 lines (72 loc) · 2.01 KB
/
next.config.mjs
File metadata and controls
76 lines (72 loc) · 2.01 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
import { fileURLToPath } from 'node:url';
import createJiti from 'jiti';
const jiti = createJiti(fileURLToPath(import.meta.url));
// Import env here to validate during build
jiti('./src/env/server');
/** @type {import('next').NextConfig} */
const nextConfig = {
// Keep SSR/basic settings default for now to match primev.xyz phase-1
// distDir: './.next',
// reactStrictMode: true,
// basePath: process.env.NEXT_PUBLIC_BASE_PATH || '',
// webpack(config) {
// // Optional: Preserve Vite-style alias if desired
// // config.resolve.alias['@'] = require('path').resolve(__dirname, 'src');
// return config;
// },
env: {
NEXT_PUBLIC_BASE_URL: (() => {
// If explicitly set in .env, use that (for local development)
if (process.env.NEXT_PUBLIC_BASE_URL) {
return process.env.NEXT_PUBLIC_BASE_URL;
}
// In Vercel (any environment), use VERCEL_URL
// VERCEL_URL is always available
if (process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`;
}
// Fallback to localhost for local development
return 'http://localhost:3000';
})(),
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'assets.coingecko.com',
pathname: '/coins/images/**',
},
{
protocol: 'https',
hostname: 'coin-images.coingecko.com',
pathname: '/coins/images/**',
},
{
protocol: 'https',
hostname: 'cryptologos.cc',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'token-icons.s3.amazonaws.com',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'raw.githubusercontent.com',
pathname: '/**',
},
{
protocol: 'https',
hostname: 'icons.llamao.fi',
pathname: '/icons/tokens/**',
},
{
protocol: 'https',
hostname: 'tokens.1inch.io',
pathname: '/**',
},
],
},
};
export default nextConfig;