Skip to content

Commit 2154845

Browse files
feat: add lazy loading feature in storybook
1 parent 20712fa commit 2154845

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

commands/storybook.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ async function storybook(serve, options) {
6767
// Get storyIds to be rendered
6868
let storyIds = static.filterStories(dirPath, storybookConfig)
6969
let maxStories = storybookConfig.chunkSize || 100;
70+
let lazyLoadedStories = [];
71+
if (Array.isArray(storybookConfig.lazyLoadedStories) && storybookConfig.lazyLoadedStories.length > 0) {
72+
lazyLoadedStories = storybookConfig.lazyLoadedStories;
73+
}
7074

7175
// Upload Storybook static
7276
await static.getSignedUrl(options)
@@ -149,7 +153,8 @@ async function storybook(serve, options) {
149153
storyIds: storyIds,
150154
waitForTimeout: storybookConfig.waitForTimeout,
151155
customViewports: storybookConfig.customViewports,
152-
useOnlyCustomViewports: storybookConfig.useOnlyCustomViewports
156+
useOnlyCustomViewports: storybookConfig.useOnlyCustomViewports,
157+
lazyLoadedStories: lazyLoadedStories
153158
},
154159
git: {
155160
branch: currentBranch || commit.branch|| '',

0 commit comments

Comments
 (0)