chatgpt2api / web /next.config.ts
tx1538's picture
Upload 179 files
9d7ddb9 verified
Raw
History Blame
828 Bytes
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import type { NextConfig } from 'next'
const projectRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
function readAppVersion() {
try {
const version = readFileSync(join(projectRoot, 'VERSION'), 'utf-8').trim()
return version || '0.0.0'
} catch {
return '0.0.0'
}
}
const appVersion = process.env.NEXT_PUBLIC_APP_VERSION || readAppVersion()
const nextConfig: NextConfig = {
allowedDevOrigins: ['127.0.0.1'],
env: {
NEXT_PUBLIC_APP_VERSION: appVersion,
},
output: 'export',
trailingSlash: true,
images: {
unoptimized: true,
},
typescript: {
ignoreBuildErrors: true,
},
}
export default nextConfig