2025-12-06 12:46:40 +09:00
|
|
|
import type { NextConfig } from "next"
|
2025-12-21 00:55:54 +09:00
|
|
|
import packageJson from "./package.json"
|
2025-03-19 06:04:06 +00:00
|
|
|
|
|
|
|
|
const nextConfig: NextConfig = {
|
2025-12-06 12:46:40 +09:00
|
|
|
/* config options here */
|
|
|
|
|
output: "standalone",
|
2025-12-22 19:58:55 +05:30
|
|
|
// Support for subdirectory deployment (e.g., https://example.com/nextaidrawio)
|
|
|
|
|
// Set NEXT_PUBLIC_BASE_PATH environment variable to your subdirectory path (e.g., /nextaidrawio)
|
|
|
|
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "",
|
2025-12-21 00:55:54 +09:00
|
|
|
env: {
|
|
|
|
|
APP_VERSION: packageJson.version,
|
|
|
|
|
},
|
2025-12-23 01:03:11 +09:00
|
|
|
// Include instrumentation.ts in standalone build for Langfuse telemetry
|
|
|
|
|
outputFileTracingIncludes: {
|
|
|
|
|
"*": ["./instrumentation.ts"],
|
|
|
|
|
},
|
2025-12-06 12:46:40 +09:00
|
|
|
}
|
2025-03-19 06:04:06 +00:00
|
|
|
|
2025-12-06 12:46:40 +09:00
|
|
|
export default nextConfig
|
2025-12-27 17:43:23 +05:30
|
|
|
|
|
|
|
|
// Initialize OpenNext Cloudflare for local development only
|
|
|
|
|
// This must be a dynamic import to avoid loading workerd binary during builds
|
|
|
|
|
if (process.env.NODE_ENV === "development") {
|
|
|
|
|
import("@opennextjs/cloudflare").then(
|
|
|
|
|
({ initOpenNextCloudflareForDev }) => {
|
|
|
|
|
initOpenNextCloudflareForDev()
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
}
|