Spaces:
Build error
Build error
File size: 1,413 Bytes
dca8ede | 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 | let userConfig = undefined
try {
// try to import ESM first
userConfig = await import('./v0-user-next.config.mjs')
} catch (e) {
try {
// fallback to CJS import
userConfig = await import("./v0-user-next.config");
} catch (innerError) {
// ignore error
}
}
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
output: 'standalone',
experimental: {
webpackBuildWorker: true,
parallelServerBuildTraces: true,
parallelServerCompiles: true,
},
async rewrites() {
return [
{
source: '/api/:path*',
destination: '/api/:path*',
},
]
},
// Detect if we're in a Hugging Face Space and configure accordingly
...(process.env.SPACE_ID ? {
// No basePath needed for HF Spaces as they use the root path
assetPrefix: process.env.NEXT_PUBLIC_SITE_URL || ''
} : {})
}
if (userConfig) {
// ESM imports will have a "default" property
const config = userConfig.default || userConfig
for (const key in config) {
if (
typeof nextConfig[key] === 'object' &&
!Array.isArray(nextConfig[key])
) {
nextConfig[key] = {
...nextConfig[key],
...config[key],
}
} else {
nextConfig[key] = config[key]
}
}
}
export default nextConfig
|