Skip to content

Commit

Permalink
fix: opt in to import.meta.* properties (#512)
Browse files Browse the repository at this point in the history
Co-authored-by: Chakir QATAB <[email protected]>
  • Loading branch information
DamianGlowala and chakAs3 authored Apr 9, 2024
1 parent 55b63c1 commit cee17f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupStorybook } from './storybook'
export interface ModuleOptions {
/**
* StorybookAPI URL
* @default process.env.STORYBOOK_URL
* @default import.meta.env.STORYBOOK_URL
* @example 'http://localhost:6006'
* @type string
*/
Expand Down Expand Up @@ -58,7 +58,7 @@ export default defineNuxtModule<ModuleOptions>({
},
},
defaults: {
url: process.env.STORYBOOK_URL || 'http://localhost:6006',
url: import.meta.env.STORYBOOK_URL || 'http://localhost:6006',
storybookRoute: '/__storybook_route',
port: 6006,
version: 'v8',
Expand All @@ -67,7 +67,7 @@ export default defineNuxtModule<ModuleOptions>({
},
async setup(options, nuxt) {

if(process.env.__STORYBOOK__)
if(import.meta.env.__STORYBOOK__)
return

logger.info('🔌 Storybook Module Setup')
Expand Down
2 changes: 1 addition & 1 deletion src/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function setupStorybook(options: any, nuxt: Nuxt) {
logger.info('✔ Storybook build done ')
logger.info(' ')
nuxt.options.devtools = {enabled:true}
process.env.__STORYBOOK__ = JSON.stringify( options )
import.meta.env.__STORYBOOK__ = JSON.stringify( options )
})

logger.info('🔗 STORYBOOK_URL :', STORYBOOK_URL)
Expand Down

0 comments on commit cee17f1

Please sign in to comment.