diff options
| author | Yuren Hao <97327730+YurenHao0426@users.noreply.github.com> | 2025-02-02 23:59:29 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-02 23:59:29 -0600 |
| commit | 1774317d667aed94b2a2f0acae885ce9420de8e2 (patch) | |
| tree | 71ca71920e68a43536bc58085ebc96e193db776a /next.config.mjs | |
initialization
Diffstat (limited to 'next.config.mjs')
| -rw-r--r-- | next.config.mjs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/next.config.mjs b/next.config.mjs new file mode 100644 index 0000000..060b74a --- /dev/null +++ b/next.config.mjs @@ -0,0 +1,48 @@ +let userConfig = undefined +try { + userConfig = await import('./v0-user-next.config') +} catch (e) { + // ignore error +} + +/** @type {import('next').NextConfig} */ +const nextConfig = { + eslint: { + ignoreDuringBuilds: true, + }, + typescript: { + ignoreBuildErrors: true, + }, + images: { + unoptimized: true, + }, + experimental: { + webpackBuildWorker: true, + parallelServerBuildTraces: true, + parallelServerCompiles: true, + }, +} + +mergeConfig(nextConfig, userConfig) + +function mergeConfig(nextConfig, userConfig) { + if (!userConfig) { + return + } + + for (const key in userConfig) { + if ( + typeof nextConfig[key] === 'object' && + !Array.isArray(nextConfig[key]) + ) { + nextConfig[key] = { + ...nextConfig[key], + ...userConfig[key], + } + } else { + nextConfig[key] = userConfig[key] + } + } +} + +export default nextConfig |
