Skip to content

Commit 3ab2528

Browse files
authored
[fix] prioritize sorting of +error files (#6108)
1 parent 4bd84b3 commit 3ab2528

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/tricky-cheetahs-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Fix sorting of files into +layout, +error, everything else.

packages/kit/src/core/sync/create_manifest_data/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ function list_files(dir, path = '', files = []) {
478478
// sort each directory in (+layout, +error, everything else) order
479479
// so that we can trace layouts/errors immediately
480480

481-
if (a.startsWith('+layout')) {
482-
if (!b.startsWith('+layout')) return -1;
483-
} else if (b.startsWith('+layout')) {
481+
if (a.startsWith('+layout') || a.startsWith('+error')) {
482+
if (!b.startsWith('+layout') && !b.startsWith('+error')) return -1;
483+
} else if (b.startsWith('+layout') || b.startsWith('+error')) {
484484
return 1;
485485
} else if (a.startsWith('__')) {
486486
if (!b.startsWith('__')) return -1;

0 commit comments

Comments
 (0)