Fix build bug
This commit is contained in:
@@ -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/**/*"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user