diff --git a/lib/core-server/src/utils/StoryIndexGenerator.ts b/lib/core-server/src/utils/StoryIndexGenerator.ts index d2df6f28b3f7..f809cc430906 100644 --- a/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -50,7 +50,7 @@ export class StoryIndexGenerator { path.join(this.options.workingDir, specifier.directory, specifier.files) ); const files = await glob(fullGlob); - files.forEach((absolutePath: Path) => { + files.sort().forEach((absolutePath: Path) => { const ext = path.extname(absolutePath); const relativePath = path.relative(this.options.workingDir, absolutePath); if (!['.js', '.jsx', '.ts', '.tsx', '.mdx'].includes(ext)) {