mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(nuxt3): use nuxt extensions for component discovery (#1649)
This commit is contained in:
parent
a5fcd5a976
commit
0dd86de586
@ -457,7 +457,7 @@ export default {
|
||||
* @version 3
|
||||
*/
|
||||
extensions: {
|
||||
$resolve: val => ['.js', '.mjs', '.ts', '.tsx', '.vue'].concat(val).filter(Boolean)
|
||||
$resolve: val => ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.vue'].concat(val).filter(Boolean)
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,7 @@ export default defineNuxtModule({
|
||||
const dirOptions: ComponentsDir = typeof dir === 'object' ? dir : { path: dir }
|
||||
const dirPath = resolveAlias(dirOptions.path, nuxt.options.alias)
|
||||
const transpile = typeof dirOptions.transpile === 'boolean' ? dirOptions.transpile : 'auto'
|
||||
const extensions = dirOptions.extensions || ['vue'] // TODO: nuxt extensions and strip leading dot
|
||||
const extensions = (dirOptions.extensions || nuxt.options.extensions).map(e => e.replace(/^\./g, ''))
|
||||
|
||||
dirOptions.level = Number(dirOptions.level || 0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user