From f0558915a2013213f3d97bd39c718d02d81c2fb0 Mon Sep 17 00:00:00 2001 From: "L.Rain" Date: Wed, 17 Apr 2024 01:02:13 +0800 Subject: [PATCH] fix: __STROYBOOK__ env --- src/module.ts | 2 +- src/storybook.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module.ts b/src/module.ts index 098f8df8..7853a498 100644 --- a/src/module.ts +++ b/src/module.ts @@ -41,7 +41,7 @@ export default defineNuxtModule({ }, async setup(options, nuxt) { - if(import.meta.env.__STORYBOOK__) + if(import.meta.env?.__STORYBOOK__) return logger.info('🔌 Storybook Module Setup') diff --git a/src/storybook.ts b/src/storybook.ts index 89f859ed..2fbab545 100644 --- a/src/storybook.ts +++ b/src/storybook.ts @@ -101,7 +101,7 @@ export async function setupStorybook(options: ModuleOptions, nuxt: Nuxt) { logger.info(' ') logger.info('✔ Storybook build done ') logger.info(' ') - process.env.__STORYBOOK__ = JSON.stringify( options ) + import.meta.env.__STORYBOOK__ = JSON.stringify( options ) }) logger.info('🔗 STORYBOOK_URL :', STORYBOOK_URL)