Skip to content

Commit

Permalink
Fix runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Jan 6, 2025
1 parent 1d2ee2f commit d04b258
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function generateModernIframeScriptCode(options: Options, projectRo
[],
options
);
const [previewFileUrl, ...previewAnnotationURLs] = [...previewAnnotations, previewOrConfigFile]
const [previewFileUrl, ...previewAnnotationURLs] = [previewOrConfigFile, ...previewAnnotations]
.filter(Boolean)
.map((path) => processPreviewAnnotation(path, projectRoot));

Expand Down
7 changes: 6 additions & 1 deletion code/renderers/react/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ import type {
StoryAnnotations,
} from 'storybook/internal/types';

import * as reactAnnotations from './entry-preview';
import * as reactDocsAnnotations from './entry-preview-docs';
import type { ReactRenderer } from './types';

export function defineConfig(config: PreviewConfigData<ReactRenderer>) {
return new PreviewConfig(config);
return new PreviewConfig({
...config,
addons: [reactAnnotations, reactDocsAnnotations, ...(config.addons ?? [])],
});
}

interface PreviewConfigData<TRenderer extends Renderer> extends ProjectAnnotations<TRenderer> {
Expand Down

0 comments on commit d04b258

Please sign in to comment.