Skip to content

Commit

Permalink
fix: sort routes for determinism
Browse files Browse the repository at this point in the history
  • Loading branch information
cha0s committed Feb 18, 2024
1 parent 460c7d6 commit fe65cb8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/react/src/router/filetree-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export async function createRoutesFromFiletree({importer, paths, resolver}) {
.slice(0, -1)
.pop()
))
.sort((l, r) => (l < r ? -1 : 1))
.forEach((path) => {
let walk = children;
const parts = ['/', ...resolve('/', path).split('/').slice(1)];
Expand Down

0 comments on commit fe65cb8

Please sign in to comment.