From d08a85cee579b20726003c6bbc505d563512b6f0 Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Thu, 13 Aug 2026 20:41:27 +0330 Subject: [PATCH] Prune Next build leftovers after standalone website deploys. Keep only .next/standalone so sites drop cache and duplicate server trees. Co-authored-by: Cursor --- scripts/websites-agent/deploy.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/websites-agent/deploy.sh b/scripts/websites-agent/deploy.sh index f9e1832..513d80b 100755 --- a/scripts/websites-agent/deploy.sh +++ b/scripts/websites-agent/deploy.sh @@ -162,6 +162,12 @@ NODE echo "removing full node_modules (standalone runtime keeps its own minimal copy)" rm -rf node_modules + # Drop Next build leftovers not needed at runtime (cache + non-standalone trees). + # Keep .next/standalone only. + if [[ -d .next ]]; then + find .next -mindepth 1 -maxdepth 1 ! -name standalone -exec rm -rf {} + + fi + echo "==== $(date -u +%Y-%m-%dT%H:%M:%SZ) deploy ok (standalone): $SLUG ====" write_status "success" "Deployed origin/$BRANCH (standalone)" trap - ERR