Skip to content

Commit 993e4d3

Browse files
authored
Fix: the unexpected clearing of symbolic link directories (#82191)
When I was using the standalone build, the second build would delete the contents of local packages. As a result, developers had to delete the cache of local empty directories and re-download the packages. I added a condition for recursive deletion to avoid this situation. Fixes #82157
1 parent 7351d92 commit 993e4d3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/lemon-islands-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'next': patch
3+
---
4+
5+
Fix the unexpected clearing of symbolic link directories

packages/next/src/lib/recursive-delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function recursiveDelete(
7979
const isNotExcluded = !exclude || !exclude.test(pp)
8080

8181
if (isNotExcluded) {
82-
if (isDirectory) {
82+
if (!isSymlink && isDirectory) {
8383
await recursiveDelete(absolutePath, exclude, pp)
8484
}
8585
return unlinkPath(absolutePath, !isSymlink && isDirectory)

0 commit comments

Comments
 (0)