mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(nuxt3): add vue-router
types when used (#1603)
This commit is contained in:
parent
8ad5d89a15
commit
2b35e92bd7
@ -15,6 +15,11 @@ export default defineNuxtModule({
|
||||
return
|
||||
}
|
||||
|
||||
// Add $router types
|
||||
nuxt.hook('prepare:types', ({ references }) => {
|
||||
references.push({ types: 'vue-router' })
|
||||
})
|
||||
|
||||
// Regenerate templates when adding or removing pages
|
||||
nuxt.hook('builder:watch', async (event, path) => {
|
||||
const pathPattern = new RegExp(`^(${nuxt.options.dir.pages}|${nuxt.options.dir.layouts})/`)
|
||||
|
Loading…
Reference in New Issue
Block a user