forked from yosemite01/stellar-creator-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
37 lines (34 loc) · 1.06 KB
/
Copy pathnext.config.mjs
File metadata and controls
37 lines (34 loc) · 1.06 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
import { execSync } from 'child_process'
function getGitSha() {
try {
return execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim()
} catch {
return process.env.NEXT_PUBLIC_BUILD_ID ?? 'unknown'
}
}
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
typescript: {
ignoreBuildErrors: true,
},
images: {
remotePatterns: [
{ protocol: 'https', hostname: '*.amazonaws.com' },
{ protocol: 'https', hostname: 'ipfs.io' },
{ protocol: 'https', hostname: '*.supabase.co' },
],
},
// Use the git SHA as the Next.js build ID so every deployment is traceable
// and two builds from the same commit produce identical BUILD_ID files.
generateBuildId: async () => getGitSha(),
env: {
NEXT_PUBLIC_GIT_SHA: getGitSha(),
NEXT_PUBLIC_BUILD_TIMESTAMP: new Date().toISOString(),
},
// Allow the reproducible build script to disable source maps for prod.
...(process.env.NEXT_DISABLE_SOURCEMAPS === '1' && {
productionBrowserSourceMaps: false,
}),
}
export default nextConfig