-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.mjs
More file actions
56 lines (50 loc) · 1.18 KB
/
next.config.mjs
File metadata and controls
56 lines (50 loc) · 1.18 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
import path from 'path'
import { fileURLToPath } from 'url'
let userConfig = undefined
try {
userConfig = await import('./v0-user-next.config')
} catch (e) {
// ignore error
}
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'res.cloudinary.com',
},
],
},
// Prevent Next from auto-inferring the repo root from unrelated lockfiles
// outside this folder (common on Windows), which can break builds.
outputFileTracingRoot: __dirname,
turbopack: {
root: __dirname,
},
experimental: {},
}
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