Fix build bug

This commit is contained in:
decolua
2026-05-14 00:28:08 +07:00
parent 58df17aa91
commit a8100e9444
4 changed files with 26 additions and 12 deletions

View File

@@ -1,16 +1,21 @@
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
import { dirname, join } from "node:path";
const projectRoot = dirname(fileURLToPath(import.meta.url));
// CLI bundling needs workspace root so tracing includes hoisted node_modules (slim ~50MB).
// Docker / default uses projectRoot so server.js lands at /app/server.js (not nested).
const tracingRoot = process.env.NEXT_TRACING_ROOT_MODE === "workspace"
? join(projectRoot, "..")
: projectRoot;
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite"],
turbopack: {
root: projectRoot
root: tracingRoot
},
outputFileTracingRoot: projectRoot,
outputFileTracingRoot: tracingRoot,
outputFileTracingExcludes: {
"*": ["./gitbook/**/*"]
},