mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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 componentTypes = options.getComponents().map(c => [
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user