Skip to content

Commit

Permalink
fix: resolve custom theme from global cli (vuejs#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed May 10, 2018
1 parent 82cd8bd commit 148e848
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ async function resolveOptions (sourceDir) {
if (siteConfig.theme) {
// use external theme
try {
themeLayoutPath = require.resolve(`vuepress-theme-${siteConfig.theme}/Layout.vue`)
themeLayoutPath = require.resolve(`vuepress-theme-${siteConfig.theme}/Layout.vue`, {
paths: [
path.resolve(__dirname),
path.resolve(sourceDir)
]
})
themePath = path.dirname(themeLayoutPath)
} catch (e) {
throw new Error(`[vuepress] Failed to load custom theme "${
Expand Down

0 comments on commit 148e848

Please sign in to comment.