Skip to content

Commit

Permalink
fix(nuxt): support multiple app presets (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Nov 13, 2023
1 parent 0b61eb0 commit 6fe806d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/histoire-plugin-nuxt/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ async function useNuxtViteConfig () {

nuxt.hook('imports:sources', presets => {
const stubbedComposables = ['useNuxtApp']
const appPreset = presets.find(p => p.from === '#app')
appPreset.imports = appPreset.imports.filter(i => typeof i !== 'string' || !stubbedComposables.includes(i))
for (const appPreset of presets.filter(p => p.from.startsWith('#app'))) {
appPreset.imports = appPreset.imports.filter(i => typeof i !== 'string' || !stubbedComposables.includes(i))
}
presets.push({
from: '#build/histoire/composables.mjs',
imports: stubbedComposables,
Expand Down

0 comments on commit 6fe806d

Please sign in to comment.