Skip to content

Commit 10d40fa

Browse files
committed
fix: sort dirs in scanDirectoryRecursively
1 parent d031d16 commit 10d40fa

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/parseAppDir.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,15 @@ export const parseAppDir = (
196196
throw new Error(`${targetDirectoryPath} is not a directory`);
197197
}
198198

199-
const filteredThisDirectoryItems = fs.readdirSync(targetDirectoryPath).filter((item) => {
200-
return !isIgnored(ig, ignorePath, targetDirectoryPath, item);
201-
});
199+
const filteredThisDirectoryItems = fs
200+
.readdirSync(targetDirectoryPath)
201+
.filter((item) => !isIgnored(ig, ignorePath, targetDirectoryPath, item))
202+
.sort();
202203

203204
const pageFile = filteredThisDirectoryItems.find((item) => PAGE_FILE_NAMES.includes(item));
204205
if (pageFile) {
205206
outputObject.registerPage({
206-
directoryRelativePath: path.relative(input, targetDirectoryPath),
207+
directoryRelativePath: path.posix.relative(input, targetDirectoryPath),
207208
importName: getImportName(path.posix.join(targetDirectoryPath, pageFile)),
208209
});
209210
}

0 commit comments

Comments
 (0)