From b27d4ee0fb95c4ba3e1039393a16582efbc7e17a Mon Sep 17 00:00:00 2001 From: harlan Date: Mon, 5 Aug 2024 14:25:20 +1000 Subject: [PATCH] refactor: avoid module declaration augmentations --- src/module.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/module.ts b/src/module.ts index 2c3b7a60..96796586 100644 --- a/src/module.ts +++ b/src/module.ts @@ -70,18 +70,9 @@ export interface ModuleOptions { } export interface ModuleHooks { - /** - * Transform a script before it's registered. - */ 'scripts:registry': (registry: RegistryScripts) => void | Promise } -declare module '@nuxt/schema' { - interface NuxtHooks { - 'scripts:registry': ModuleHooks['scripts:registry'] - } -} - export default defineNuxtModule({ meta: { name: '@nuxt/scripts', @@ -140,6 +131,7 @@ export default defineNuxtModule({ nuxt.hooks.hook('modules:done', async () => { const registryScripts = [...scripts] + // @ts-ignore nuxi prepare is broken to generate these types, possibly because of the runtime path await nuxt.hooks.callHook('scripts:registry', registryScripts) const registryScriptsWithImport = registryScripts.filter(i => !!i.import?.name) as Required[] addImports(registryScriptsWithImport.map((i) => {