File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1- import { resolve , dirname } from 'path'
1+ import { resolve , dirname , join } from 'path'
22import Vue from '@vitejs/plugin-vue'
33import ViteIcons from 'vite-plugin-icons'
44import ViteComponents from 'vite-plugin-components'
@@ -117,7 +117,7 @@ export async function resolveOptions(
117117 const roots = uniq ( [ clientRoot , ...themeRoots , userRoot ] )
118118
119119 if ( themeRoots . length ) {
120- const themeMeta = await getThemeMeta ( theme , themeRoots [ 0 ] )
120+ const themeMeta = await getThemeMeta ( theme , join ( themeRoots [ 0 ] , 'package.json' ) )
121121 if ( themeMeta )
122122 data . config = parser . resolveConfig ( data . headmatter , themeMeta )
123123 }
Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ export function packageExists(name: string) {
2222 return false
2323}
2424
25- export async function getThemeMeta ( name : string , path ?: string ) {
26- path ||= resolveImportPath ( `${ name } /package.json` )
25+ export async function getThemeMeta ( name : string , path : string ) {
26+ if ( ! fs . existsSync ( path ) )
27+ return { }
2728
2829 if ( path ) {
2930 const { slidev = { } , engines = { } } = await fs . readJSON ( path )
You can’t perform that action at this time.
0 commit comments