Skip to content

Commit b27d4ee

Browse files
committed
refactor: avoid module declaration augmentations
1 parent 05f085e commit b27d4ee

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Diff for: src/module.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,9 @@ export interface ModuleOptions {
7070
}
7171

7272
export interface ModuleHooks {
73-
/**
74-
* Transform a script before it's registered.
75-
*/
7673
'scripts:registry': (registry: RegistryScripts) => void | Promise<void>
7774
}
7875

79-
declare module '@nuxt/schema' {
80-
interface NuxtHooks {
81-
'scripts:registry': ModuleHooks['scripts:registry']
82-
}
83-
}
84-
8576
export default defineNuxtModule<ModuleOptions>({
8677
meta: {
8778
name: '@nuxt/scripts',
@@ -140,6 +131,7 @@ export default defineNuxtModule<ModuleOptions>({
140131
nuxt.hooks.hook('modules:done', async () => {
141132
const registryScripts = [...scripts]
142133

134+
// @ts-ignore nuxi prepare is broken to generate these types, possibly because of the runtime path
143135
await nuxt.hooks.callHook('scripts:registry', registryScripts)
144136
const registryScriptsWithImport = registryScripts.filter(i => !!i.import?.name) as Required<RegistryScript>[]
145137
addImports(registryScriptsWithImport.map((i) => {

0 commit comments

Comments
 (0)