From fe65cb863bee9a6b369651c2fd8c241b6217a3bf Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 18 Feb 2024 10:45:39 -0600 Subject: [PATCH] fix: sort routes for determinism --- packages/react/src/router/filetree-router.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react/src/router/filetree-router.js b/packages/react/src/router/filetree-router.js index 6ea449d..9919691 100644 --- a/packages/react/src/router/filetree-router.js +++ b/packages/react/src/router/filetree-router.js @@ -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)];