Skip to content

Commit

Permalink
Fix error when no preview file is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Feb 19, 2022
1 parent 6c556e1 commit bfc38e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/storybook-builder-vite/codegen-iframe-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export async function generateIframeScriptCode(
} from '@storybook/client-api';
import { logger } from '@storybook/client-logger';
${absoluteFilesToImport(configEntries, 'config')}
import preview from '${previewFilename}';
import * as preview from '${previewFilename}';
import { configStories } from '${storiesFilename}';
const configs = [${importArray('config', configEntries.length).concat('preview').join(',')}]
const configs = [${importArray('config', configEntries.length).concat('preview.default').join(',')}].filter(Boolean)
configs.forEach(config => {
Object.keys(config).forEach((key) => {
Expand Down

0 comments on commit bfc38e9

Please sign in to comment.