// .vitepress/theme/index.js import DefaultTheme from 'vitepress/theme' import './custom.css' /** @type {import('vitepress').Theme} */ export default { extends: DefaultTheme, enhanceApp({ app }) { const components = import.meta.glob('./components/*.vue', { eager: true }) for (const path in components) { mcomponents[path]().then((c) => { console.log(path, c) }) } Object.entries(components).forEach(([path, definition]) => { const componentName = path.split('/').pop().replace(/\.\w+$/, '') console.log(componentName) app.component(componentName, definition.default) }) } }