Skip to content

Commit

Permalink
fix: use prepare:types and ensure they are hoisted
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 22, 2024
1 parent 146cad4 commit f83db55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ export default defineNuxtModule<ModuleOptions>({
})
})

addTypeTemplate({
filename: 'types/cloudflare-turnstile.d.ts',
getContents: () => `/// <reference types="@types/cloudflare-turnstile" />`,
nuxt.hook('prepare:types', ({ references }) => {
references.push({ types: '@types/cloudflare-turnstile' })
})
nuxt.options.typescript.hoist.push('@types/cloudflare-turnstile')
},
})
1 change: 0 additions & 1 deletion src/runtime/composables/turnstile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="@types/cloudflare-turnstile" />
import { useRegistryScript } from '#nuxt-scripts-utils'
import type { RegistryScriptInput } from '#nuxt-scripts'

Expand Down

0 comments on commit f83db55

Please sign in to comment.