mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): rename stub to avoid shadowing vue-router
(#23440)
This commit is contained in:
parent
17e6c1f7fb
commit
1b34386707
@ -75,11 +75,11 @@ export default defineNuxtModule({
|
||||
|
||||
// adds support for #vue-router alias (used for types) with and without pages integration
|
||||
addTemplate({
|
||||
filename: 'vue-router.d.ts',
|
||||
filename: 'vue-router-stub.d.ts',
|
||||
getContents: () => `export * from '${useExperimentalTypedPages ? 'vue-router/auto' : 'vue-router'}'`
|
||||
})
|
||||
|
||||
nuxt.options.alias['#vue-router'] = join(nuxt.options.buildDir, 'vue-router')
|
||||
nuxt.options.alias['#vue-router'] = join(nuxt.options.buildDir, 'vue-router-stub')
|
||||
|
||||
if (!nuxt.options.pages) {
|
||||
addPlugin(resolve(distDir, 'app/plugins/router'))
|
||||
@ -96,7 +96,7 @@ export default defineNuxtModule({
|
||||
}
|
||||
|
||||
addTemplate({
|
||||
filename: 'vue-router.mjs',
|
||||
filename: 'vue-router-stub.mjs',
|
||||
// TODO: use `vue-router/auto` when we have support for page metadata
|
||||
getContents: () => 'export * from \'vue-router\';'
|
||||
})
|
||||
@ -451,7 +451,7 @@ export default defineNuxtModule({
|
||||
nuxt.hook('prepare:types', ({ references }) => {
|
||||
references.push({ path: resolve(nuxt.options.buildDir, 'types/middleware.d.ts') })
|
||||
references.push({ path: resolve(nuxt.options.buildDir, 'types/layouts.d.ts') })
|
||||
references.push({ path: resolve(nuxt.options.buildDir, 'vue-router.d.ts') })
|
||||
references.push({ path: resolve(nuxt.options.buildDir, 'vue-router-stub.d.ts') })
|
||||
})
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user