Prune Next build leftovers after standalone website deploys.
Keep only .next/standalone so sites drop cache and duplicate server trees. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
9818721bce
commit
d08a85cee5
@@ -162,6 +162,12 @@ NODE
|
|||||||
echo "removing full node_modules (standalone runtime keeps its own minimal copy)"
|
echo "removing full node_modules (standalone runtime keeps its own minimal copy)"
|
||||||
rm -rf node_modules
|
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 ===="
|
echo "==== $(date -u +%Y-%m-%dT%H:%M:%SZ) deploy ok (standalone): $SLUG ===="
|
||||||
write_status "success" "Deployed origin/$BRANCH (standalone)"
|
write_status "success" "Deployed origin/$BRANCH (standalone)"
|
||||||
trap - ERR
|
trap - ERR
|
||||||
|
|||||||
Reference in New Issue
Block a user