Skip to content

Commit ec575b9

Browse files
committed
chore($core): resolve theme path to the dir of main file (close vuejs#1204)
1 parent 9fb5c5f commit ec575b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@vuepress/core/lib/prepare/loadTheme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module.exports = async function loadTheme (ctx) {
176176
function normalizeThemePath (resolved) {
177177
const { entry, name, fromDep } = resolved
178178
if (fromDep) {
179-
const pkgPath = require.resolve(`${name}/package.json`)
179+
const pkgPath = require.resolve(name)
180180
return path.parse(pkgPath).dir
181181
} else if (entry.endsWith('.js') || entry.endsWith('.vue')) {
182182
return path.parse(entry).dir

0 commit comments

Comments
 (0)