Skip to content

Commit

Permalink
fix resolving preset on windows tag alpha.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chakAs3 committed Oct 3, 2023
1 parent 5ce92a6 commit 4fca05d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/storybook-nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook-vue/nuxt",
"version": "0.1.6-alpha.0",
"version": "0.1.6-alpha.6",
"packageManager": "[email protected]",
"description": "Storybook for Nuxt and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/storybook-nuxt/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dirname, join, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { fileURLToPath, pathToFileURL } from 'node:url'
import { createRequire } from 'node:module'
import type { PresetProperty } from '@storybook/types'
import { type UserConfig as ViteConfig, mergeConfig, searchForWorkspaceRoot } from 'vite'
Expand Down Expand Up @@ -126,9 +126,9 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (
options: any,
) => {
const getStorybookViteConfig = async (c: Record<string, any>, o: any) => {
const pkgPath = await getPackageDir('@storybook/vue3-vite')

const { viteFinal: ViteFile } = await import(join(pkgPath, 'preset.js'))
// const pkgPath = await getPackageDir('@storybook/vue3-vite')
const presetURL = pathToFileURL(join(await getPackageDir('@storybook/vue3-vite'), 'preset.js'))
const { viteFinal: ViteFile } = await import(presetURL.href)

if (!ViteFile)
throw new Error('ViteFile not found')
Expand Down

0 comments on commit 4fca05d

Please sign in to comment.