diff --git a/packages/histoire-plugin-nuxt/runtime/composables.mjs b/packages/histoire-plugin-nuxt/runtime/composables.mjs deleted file mode 100644 index 9b9a4d8d..00000000 --- a/packages/histoire-plugin-nuxt/runtime/composables.mjs +++ /dev/null @@ -1 +0,0 @@ -export const useNuxtApp = () => ({ runWithContext: async fn => await fn() }) diff --git a/packages/histoire-plugin-nuxt/src/index.ts b/packages/histoire-plugin-nuxt/src/index.ts index b284eeaf..1f0bda21 100644 --- a/packages/histoire-plugin-nuxt/src/index.ts +++ b/packages/histoire-plugin-nuxt/src/index.ts @@ -135,7 +135,6 @@ async function useNuxtViteConfig() { } const runtimeDir = fileURLToPath(new URL('../runtime', import.meta.url)) nuxt.options.build.templates.push( - { src: join(runtimeDir, 'composables.mjs'), filename: 'histoire/composables.mjs' }, { src: join(runtimeDir, 'components.mjs'), filename: 'histoire/components.mjs' }, ) @@ -144,17 +143,6 @@ async function useNuxtViteConfig() { app.templates.push({ src: join(runtimeDir, 'app-component.mjs'), filename: 'app-component.mjs' }) }) - nuxt.hook('imports:sources', (presets) => { - const stubbedComposables = ['useNuxtApp'] - 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, - }) - }) - return { viteConfig: await new Promise((resolve, reject) => { nuxt.hook('modules:done', () => {