From 4e15f69a039cfff38917d24354962d09b07e11cb Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Tue, 8 Nov 2022 17:01:35 -0500 Subject: [PATCH] Fix addon handling in SSv6 --- code/lib/builder-vite/src/codegen-iframe-script.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/lib/builder-vite/src/codegen-iframe-script.ts b/code/lib/builder-vite/src/codegen-iframe-script.ts index 18888a1b8c6..f81dc1ace57 100644 --- a/code/lib/builder-vite/src/codegen-iframe-script.ts +++ b/code/lib/builder-vite/src/codegen-iframe-script.ts @@ -1,5 +1,4 @@ -import { isAbsolute, resolve } from 'path'; -import { getRendererName } from '@storybook/core-common'; +import { getRendererName, getFrameworkName } from '@storybook/core-common'; import { virtualPreviewFile, virtualStoriesFile } from './virtual-file-names'; import type { ExtendedOptions } from './types'; import { processPreviewAnnotation } from './utils/process-preview-annotation'; @@ -8,12 +7,9 @@ export async function generateIframeScriptCode(options: ExtendedOptions) { const { presets } = options; const rendererName = await getRendererName(options); const previewAnnotations = await presets.apply('previewAnnotations', [], options); - const resolvedPreviewAnnotations = previewAnnotations.map((entry) => - isAbsolute(entry) ? entry : resolve(entry) - ); - const configEntries = [...resolvedPreviewAnnotations].filter(Boolean); + const configEntries = [...previewAnnotations].filter(Boolean); - const absoluteFilesToImport = (files: string[], name: string) => + const filesToImport = (files: string[], name: string) => files .map( (el, i) => @@ -34,7 +30,7 @@ export async function generateIframeScriptCode(options: ExtendedOptions) { import * as clientApi from "@storybook/client-api"; import { logger } from '@storybook/client-logger'; - ${absoluteFilesToImport(configEntries, 'config')} + ${filesToImport(configEntries, 'config')} import * as preview from '${virtualPreviewFile}'; import { configStories } from '${virtualStoriesFile}';