mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
fix(nuxt3): respect dirs as objects (#3364)
This commit is contained in:
parent
34f1c510b2
commit
bb31df9944
@ -18,7 +18,7 @@ export default defineNuxtModule<ComponentsOptions>({
|
||||
configKey: 'components'
|
||||
},
|
||||
defaults: {
|
||||
dirs: ['~/components']
|
||||
dirs: []
|
||||
},
|
||||
setup (componentOptions, nuxt) {
|
||||
let componentDirs = []
|
||||
@ -39,6 +39,15 @@ export default defineNuxtModule<ComponentsOptions>({
|
||||
}))
|
||||
}
|
||||
}
|
||||
if (dir && typeof dir === 'object') {
|
||||
return {
|
||||
...dir,
|
||||
path: resolve(cwd, resolveAlias(dir.path, {
|
||||
...nuxt.options.alias,
|
||||
'~': cwd
|
||||
}))
|
||||
}
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user