Skip to content

Commit 44d87c3

Browse files
committed
Prevent build failure for storybook metadata creation
1 parent b5d33fe commit 44d87c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.storybook/createMetadata.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const main = async () => {
2222

2323
dirContents.forEach(async file => {
2424
const contents = require(path.join(STORIES_PATH, file))
25-
stories[contents.default.title] = Object.keys(contents).filter(key => key !== 'default')
25+
if (contents.default) {
26+
stories[contents.default.title] = Object.keys(contents).filter(key => key !== 'default')
27+
}
2628
})
2729

2830
fs.writeFileSync(METADATA_FILEPATH, JSON.stringify(stories), 'utf8')

0 commit comments

Comments
 (0)