From a57ae44134f766068acca3c1004fd41729c25ee9 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Thu, 17 Sep 2026 23:11:05 +0800 Subject: [PATCH] fix: retain nested standalone dependencies --- scripts/deploy.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.mjs b/scripts/deploy.mjs index 0fa171f..0769f05 100644 --- a/scripts/deploy.mjs +++ b/scripts/deploy.mjs @@ -69,8 +69,12 @@ async function followBuild(stream) { console.log(`Building ${image}`); const context = tar.pack(process.cwd(), { - ignore: (name) => [".git", "node_modules", ...usePrebuiltOutput ? [] : [".next"]] - .some((part) => name === part || name.includes(`/${part}/`)), + ignore: (name) => { + const relative = name.replace(/^\.\//, ""); + if (relative === ".git" || relative.startsWith(".git/")) return true; + if (relative === "node_modules" || relative.startsWith("node_modules/")) return true; + return !usePrebuiltOutput && (relative === ".next" || relative.startsWith(".next/")); + }, }); await followBuild(await docker.buildImage(context, { t: image, dockerfile }));