mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
chore: add fixes for components discovery
This commit is contained in:
parent
a0f81cd1fb
commit
36a3d285d8
@ -5,7 +5,8 @@ import { scanComponents } from './scan'
|
||||
import type { ComponentsDir } from './types'
|
||||
|
||||
const isPureObjectOrString = (val: any) => (!Array.isArray(val) && typeof val === 'object') || typeof val === 'string'
|
||||
const getDir = (p: string) => fs.statSync(p).isDirectory() ? p : dirname(p)
|
||||
const isDirectory = (p: string) => { try { return fs.statSync(p).isDirectory() } catch (_e) { return false } }
|
||||
const getDir = (p: string) => isDirectory(p) ? p : dirname(p)
|
||||
|
||||
export default defineNuxtModule({
|
||||
name: 'components',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<HelloWorld />
|
||||
Hello World
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user