Skip to content

Commit 8c75418

Browse files
committedMar 25, 2025·
fix: avoid registering the registry composables twice
Fixes #308
1 parent 2e55b21 commit 8c75418

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
@@ -130,9 +130,6 @@ export default defineNuxtModule<ModuleOptions>({
130130
}
131131
addImportsDir([
132132
resolve('./runtime/composables'),
133-
// auto-imports aren't working without this for some reason
134-
// TODO find solution as we're double-registering
135-
resolve('./runtime/registry'),
136133
])
137134

138135
addComponentsDir({
@@ -146,12 +143,7 @@ export default defineNuxtModule<ModuleOptions>({
146143
// @ts-expect-error nuxi prepare is broken to generate these types, possibly because of the runtime path
147144
await nuxt.hooks.callHook('scripts:registry', registryScripts)
148145
const registryScriptsWithImport = registryScripts.filter(i => !!i.import?.name) as Required<RegistryScript>[]
149-
addImports(registryScriptsWithImport.map((i) => {
150-
return {
151-
priority: -1,
152-
...i.import,
153-
}
154-
}))
146+
addImports(registryScriptsWithImport.map(i => i.import))
155147

156148
// compare the registryScripts to the original registry to find new scripts
157149
const newScripts = registryScriptsWithImport.filter(i => !scripts.some(r => r.import?.name === i.import.name))

0 commit comments

Comments
 (0)
Please sign in to comment.