fix: retain nested standalone dependencies
CI / verify (push) Successful in 6m10s

This commit is contained in:
2026-09-17 23:11:05 +08:00
parent bac753cb74
commit a57ae44134
+6 -2
View File
@@ -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 }));