Skip to content

Commit 03c81dc

Browse files
committed
chore: add some greater stability
1 parent f9892d0 commit 03c81dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/histoire-plugin-nuxt/src

‎packages/histoire-plugin-nuxt/src/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ async function useNuxtViteConfig() {
149149
nuxt.hook('imports:sources', (presets) => {
150150
const polyfills = ['requestIdleCallback', 'cancelIdleCallback']
151151
const stubbedComposables = ['useNuxtApp']
152-
for (const appPreset of presets.filter(p => 'from' in p && p.from?.startsWith('#app'))) {
153-
if ('imports' in appPreset) {
152+
for (const appPreset of presets.filter(p => p && typeof p === 'object' && 'from' in p && p.from?.startsWith('#app'))) {
153+
if ('imports' in appPreset && Array.isArray(appPreset.imports)) {
154154
appPreset.imports = appPreset.imports.filter(i => typeof i !== 'string' || (!stubbedComposables.includes(i) && !polyfills.includes(i)))
155155
}
156156
}

0 commit comments

Comments
 (0)