Skip to content

Commit

Permalink
fix: use appId and buildId as fallbacks, use vite:configResolved ho…
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Jun 1, 2024
1 parent 81cb140 commit ce6b751
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/storybook-nuxt/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ async function defineNuxtConfig(baseConfig: {
)

nuxt = await loadNuxt({
rootDir: baseConfig.root,
cwd: baseConfig.root,
ready: false,
dev: false,

overrides: {
buildDir: '.nuxt-storybook',
// @ts-expect-error: this is actually correct, but would require to use generated types
appId: 'nuxt-app',
buildId: 'storybook',
ssr: false,
},
})

Expand Down Expand Up @@ -104,7 +106,7 @@ async function defineNuxtConfig(baseConfig: {
await nuxt.ready()
return new Promise<{ viteConfig: ViteConfig; nuxt: Nuxt }>(
(resolve, reject) => {
nuxt.hook('vite:extendConfig', (config, { isClient }) => {
nuxt.hook('vite:configResolved', (config, { isClient }) => {
if (isClient) {
extendedConfig = mergeConfig(config, baseConfig)

Expand Down

0 comments on commit ce6b751

Please sign in to comment.