Skip to content

Commit

Permalink
feat: auto-import v and vh in vue
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed Dec 13, 2024
1 parent 0d4d769 commit c455488
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineNuxtModule({
name: 'h3-valibot',
},
defaults: {},
async setup(_options, _nuxt) {
async setup(_options, nuxt) {
addServerImports([
{
name: 'useSafeValidatedBody',
Expand Down Expand Up @@ -41,5 +41,16 @@ export default defineNuxtModule({
from: 'h3-valibot',
},
])

nuxt.hook('imports:extend', (imports) => {
imports.push({
name: 'vh',
from: 'h3-valibot',
})
imports.push({
name: 'v',
from: 'h3-valibot',
})
})
},
})

0 comments on commit c455488

Please sign in to comment.