mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 01:53:55 +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'
|
import type { ComponentsDir } from './types'
|
||||||
|
|
||||||
const isPureObjectOrString = (val: any) => (!Array.isArray(val) && typeof val === 'object') || typeof val === 'string'
|
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({
|
export default defineNuxtModule({
|
||||||
name: 'components',
|
name: 'components',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<HelloWorld />
|
Hello World
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user