mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
fix(nuxt): strip non-.vue
extensions from component types (#7673)
This commit is contained in:
parent
334e2aba4b
commit
347abcd065
@ -75,7 +75,9 @@ export const componentsTypeTemplate: NuxtTemplate<ComponentsTemplateContext> = {
|
|||||||
const buildDir = nuxt.options.buildDir
|
const buildDir = nuxt.options.buildDir
|
||||||
const componentTypes = options.getComponents().map(c => [
|
const componentTypes = options.getComponents().map(c => [
|
||||||
c.pascalName,
|
c.pascalName,
|
||||||
`typeof ${genDynamicImport(isAbsolute(c.filePath) ? relative(buildDir, c.filePath) : c.filePath, { wrapper: false })}['${c.export}']`
|
`typeof ${genDynamicImport(isAbsolute(c.filePath)
|
||||||
|
? relative(buildDir, c.filePath).replace(/(?<=\w)\.(?!vue)\w+$/g, '')
|
||||||
|
: c.filePath.replace(/(?<=\w)\.(?!vue)\w+$/g, ''), { wrapper: false })}['${c.export}']`
|
||||||
])
|
])
|
||||||
|
|
||||||
return `// Generated by components discovery
|
return `// Generated by components discovery
|
||||||
|
Loading…
Reference in New Issue
Block a user