You can reference files by full path if you want

This commit is contained in:
Tom Coleman 2023-03-03 10:36:46 +11:00
parent c1239410a0
commit 71aee82a65

View File

@ -222,7 +222,7 @@ export class StoryIndexGenerator {
if (!cacheEntry || cacheEntry.type !== 'stories') return false;
return !!absoluteImports.find((storyImport) =>
fileName.match(new RegExp(`^${storyImport}\\.[^.]+$`))
fileName.match(new RegExp(`^${storyImport}(\\.[^.]+)?$`))
);
})
.map(([_, cacheEntry]) => cacheEntry as StoriesCacheEntry)