Unverified Commit 10213b36 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Fix pack-next script for next-swc (#88126)

parent a3b07ce5
......@@ -168,11 +168,11 @@ export async function packageFiles(path: string): Promise<string[]> {
// We add the full path, but check for parent directories too.
// This catches the case where the whole directory is added and then a single file from the directory.
// The sorting before ensures that the directory comes before the files inside of the directory.
set.add(f)
while (f.includes('/')) {
f = f.replace(/\/[^/]+$/, '')
f = f.replace(/\/[^/]*$/, '')
if (set.has(f)) return false
}
set.add(f)
return true
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment