提交 febe3a71 编写于 作者: L Liu Xinyu 提交者: ULIVZ

feat($core): allow a theme package using a sub directory (close #1204) (#1206)

上级 199f18e5
......@@ -176,7 +176,7 @@ module.exports = async function loadTheme (ctx) {
function normalizeThemePath (resolved) {
const { entry, name, fromDep } = resolved
if (fromDep) {
const pkgPath = require.resolve(`${name}/package.json`)
const pkgPath = require.resolve(name)
return path.parse(pkgPath).dir
} else if (entry.endsWith('.js') || entry.endsWith('.vue')) {
return path.parse(entry).dir
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册