Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritize sorting of +error files #6108

Merged
merged 1 commit into from Aug 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tricky-cheetahs-warn.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Fix sorting of files into +layout, +error, everything else.
6 changes: 3 additions & 3 deletions packages/kit/src/core/sync/create_manifest_data/index.js
Expand Up @@ -478,9 +478,9 @@ function list_files(dir, path = '', files = []) {
// sort each directory in (+layout, +error, everything else) order
// so that we can trace layouts/errors immediately

if (a.startsWith('+layout')) {
if (!b.startsWith('+layout')) return -1;
} else if (b.startsWith('+layout')) {
if (a.startsWith('+layout') || a.startsWith('+error')) {
if (!b.startsWith('+layout') && !b.startsWith('+error')) return -1;
} else if (b.startsWith('+layout') || b.startsWith('+error')) {
return 1;
} else if (a.startsWith('__')) {
if (!b.startsWith('__')) return -1;
Expand Down