Open History to see the last commit
1import { cp, mkdir, rm, writeFile } from "node:fs/promises";
2
3// Vercel's Build Output API accepts this static bundle without uploading source
4// files or the private Neon environment. API requests go directly to Neon.
5const output = new URL("../.vercel/output/", import.meta.url);
6await rm(output, { recursive: true, force: true });
7await mkdir(output, { recursive: true });
8await cp(new URL("../dist/", import.meta.url), new URL("static/", output), {
9 recursive: true,
10});
11await writeFile(
12 new URL("config.json", output),
13 JSON.stringify({
14 version: 3,
15 routes: [{ handle: "filesystem" }, { src: "/.*", dest: "/index.html" }],
16 }),
17);
18console.log(
19 "Prepared static frontend in .vercel/output (no Vercel Functions).",
20);