Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/presets/vercel/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fsp from "node:fs/promises";
import { constants } from "node:fs";
import { defu } from "defu";
import { writeFile } from "../_utils/fs.ts";
import type { Nitro, NitroRouteRules } from "nitro/types";
import { dirname, relative, resolve } from "pathe";
import { basename, dirname, relative, resolve } from "pathe";
import { Router } from "../../routing.ts";
import { joinURL, withLeadingSlash, withoutLeadingSlash } from "ufo";
import type {
Expand Down Expand Up @@ -636,11 +637,11 @@ async function createFunctionDirWithCustomConfig(
overrides: VercelServerlessFunctionConfig,
functionPath: string
) {
// Copy the entire server directory instead of symlinking individual
// entries. Vercel's build container preserves symlinks in the Lambda
// zip, but symlinks pointing outside the .func directory break at
// runtime because the target path doesn't exist on Lambda.
await fsp.cp(serverDir, funcDir, { recursive: true });
await fsp.cp(serverDir, funcDir, {
recursive: true,
mode: constants.COPYFILE_FICLONE,
filter: (src) => basename(src) !== ".vc-config.json",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
});
const mergedConfig = defu(overrides, baseFunctionConfig);
for (const [key, value] of Object.entries(overrides)) {
if (Array.isArray(value)) {
Expand Down
Loading