mirror of
https://github.com/ChiChou/entdb.git
synced 2026-12-05 11:13:40 +01:00
Each query is one whole-file fetch from entdb-data's new record layout
(list.json, b/{build}, k/{hash(key)}, p/{hash(path)}), cached for the
session. The KV engine and client are removed with no fallback; the site
and data deploy together.
- listOS() returns a copy, so pages sorting it can't reorder the cached
build ordinals.
- The version switcher reads the list through the engine (one fetch).
- ENTDB_DATA_ORIGIN points dev at a local data server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
725 B
TypeScript
26 lines
725 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
|
|
const isDev = process.env.NODE_ENV === "development";
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: isDev ? undefined : "export",
|
|
basePath,
|
|
assetPrefix: basePath || undefined,
|
|
env: {
|
|
NEXT_PUBLIC_BUILD_TIME: new Date().toISOString(),
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/data/:path*",
|
|
// Point at a local build with ENTDB_DATA_ORIGIN, e.g. entdb-data's
|
|
// `python scripts/serve.py build-output` on http://localhost:8787.
|
|
destination: `${process.env.ENTDB_DATA_ORIGIN ?? "https://codecolor.ist/entdb-data"}/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|