Files
DeepTutor/web/next.config.js
Bingxi Zhao (Frank) 2f6ac5aa80 release: v1.2.2 — Skills system, input perf, response_format auto-fallback, version badge
- User-authored Skills system (CRUD backend + REST API + chat composer integration)
- Chat input performance overhaul: ComposerInput / SimpleComposerInput state colocation
- response_format auto-fallback & runtime cache for incompatible providers
- LAN remote access fix (resolveBase hostname swap)
- Sidebar version badge with GitHub release comparison + GitHub icon link
- Deep Solve image attachment support via unified Attachment pipeline
- Agentic chat pipeline attachment passthrough in responding + acting stages
- TutorBot WebSocket auto-start, _safe_send, graceful disconnect
- Settings page API key masking with Eye/EyeOff toggle
- Book Library UI with search, status cards, and simplified BookSidebar
- Visualization fullscreen mode for SVG/Mermaid/ChartJS
- Embedding ConnectError retry, RAG None-embedding hardening
- KB delete robustness for orphaned config entries
- CLI parse_json_object whitespace normalization
- answer_now response_format guard
- New tests: TutorBot WS, CLI helpers, route-params, api-resolve-base
- Release notes (ver1-2-2.md) and README update

Made-with: Cursor
2026-04-22 20:45:51 +08:00

64 lines
1.9 KiB
JavaScript

/** @type {import('next').NextConfig} */
// Resolve the build-time application version. Priority:
// 1. Explicit APP_VERSION env (set by CI from the release tag)
// 2. `git describe --tags` when building from a checkout (local dev)
// 3. Empty string → frontend treats it as "unknown" and shows the
// latest GitHub release as a neutral fallback.
const APP_VERSION = (() => {
if (process.env.APP_VERSION) return process.env.APP_VERSION;
try {
const { execSync } = require("child_process");
return execSync("git describe --tags --always --dirty=-dev", {
stdio: ["ignore", "pipe", "ignore"],
})
.toString()
.trim();
} catch {
return "";
}
})();
const nextConfig = {
// Expose the build-time version to the browser so the sidebar badge
// can compare it against GitHub's latest release.
env: {
NEXT_PUBLIC_APP_VERSION: APP_VERSION,
},
// Standalone output: self-contained server.js + minimal node_modules
// This eliminates the need to copy the full node_modules into Docker production images
output: "standalone",
// Move dev indicator to bottom-right corner
devIndicators: {
position: "bottom-right",
},
// Transpile mermaid and related packages for proper ESM handling
transpilePackages: ["mermaid"],
// Turbopack configuration (used when running `npm run dev:turbo`)
turbopack: {
resolveAlias: {
// Fix for mermaid's cytoscape dependency - use CJS version
cytoscape: "cytoscape/dist/cytoscape.cjs.js",
},
},
// Webpack configuration (used for production builds - next build)
webpack: (config) => {
const path = require("path");
config.resolve.alias = {
...config.resolve.alias,
cytoscape: path.resolve(
__dirname,
"node_modules/cytoscape/dist/cytoscape.cjs.js",
),
};
return config;
},
};
module.exports = nextConfig;