-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.mjs
More file actions
27 lines (23 loc) · 770 Bytes
/
next.config.mjs
File metadata and controls
27 lines (23 loc) · 770 Bytes
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
import path from "path"
import { fileURLToPath } from "url"
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const apiBase = process.env.NEXT_PUBLIC_API_URL || "http://localhost:4000/api/v1"
const apiOrigin = apiBase.replace(/\/api\/v1\/?$/, "")
/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
// Fix 404 when multiple lockfiles exist (parent dir): force project root
outputFileTracingRoot: __dirname,
// Proxy /api/uploads/* to backend so avatar images work (avoids CORS/CORP block)
async rewrites() {
return [
{ source: "/api/uploads/:path*", destination: `${apiOrigin}/uploads/:path*` },
]
},
}
export default nextConfig