openclaw/apps/web/next.config.ts
kumarabhirup a1a54403a5
Gateway: ship Ironclaw web app as a managed sidecar
- Add gateway.webApp config (enabled, port, dev) as the unified toggle
  for both the Next.js web UI and the built-in control UI
- Spawn Next.js app alongside the gateway; stop it on shutdown
- Auto-enable webApp in config for new and existing installs
- Pre-build Next.js in deploy.sh and ship .next/ in the npm package
  so installed users get instant startup (no build step)
- Gateway skips build when pre-built .next/ exists; builds on first
  run for dev/git-checkout users
- Onboarding "Open the Web UI" now opens the Ironclaw web app
- Fix pre-existing Next.js build errors (ES2023 lib, Tiptap v3 types,
  Suspense boundary, ReportConfig type alignment)
- Rename deploy target from openclaw-ai-sdk to ironclaw

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:37:56 -08:00

30 lines
912 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Produce a self-contained build in .next/standalone so the npm package
// can run `node .next/standalone/server.js` without a full node_modules.
output: "standalone",
// Allow long-running API routes for agent streaming
serverExternalPackages: [],
// Transpile ESM-only packages so webpack can bundle them
transpilePackages: ["react-markdown", "remark-gfm"],
// Ensure Node.js built-ins work correctly
webpack: (config, { isServer }) => {
if (isServer) {
// Don't attempt to bundle Node.js built-ins
config.externals = config.externals || [];
config.externals.push({
"node:child_process": "commonjs node:child_process",
"node:path": "commonjs node:path",
"node:readline": "commonjs node:readline",
});
}
return config;
},
};
export default nextConfig;