From 4ad79d799eba85cf355b8bdf606f1ef70a9bcc0d Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 20 Aug 2024 12:42:01 +0200 Subject: [PATCH] fix: improve virtual module handling to support storybook v8 Fixes #103. --- src/core/logger.ts | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/logger.ts b/src/core/logger.ts index 617ec5f0..cb94bd09 100644 --- a/src/core/logger.ts +++ b/src/core/logger.ts @@ -1,3 +1,3 @@ import { consola } from 'consola' export const logger = consola.withTag('[storybook:vue]') -// logger.level = LogLevel.Debug +// logger.level = 4 // Debug diff --git a/src/index.ts b/src/index.ts index bf932845..01d88229 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,8 +22,8 @@ export const unpluginFactory: UnpluginFactory = ( ...options, })) as { id: string; external: boolean } - // If it cannot be resolved or is external, just return it so that Rollup can display an error - if (!resolution || resolution.external) return resolution + // If it cannot be resolved or is external, return undefined so that the next plugin can handle it + if (!resolution || resolution.external) return undefined // We append a custom "type" so that the vue plugin is not handling the import resolution.id = resolution.id + STORIES_INTERNAL_SUFFIX