Skip to content

Commit

Permalink
fix: resolve custom theme from global cli (close: #392) (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy authored and ulivz committed May 10, 2018
1 parent cefc8c3 commit 01142df
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, '../node_modules'),
path.resolve(sourceDir)
]
})
themePath = path.dirname(themeLayoutPath)
} catch (e) {
throw new Error(`[vuepress] Failed to load custom theme "${
Expand Down

0 comments on commit 01142df

Please sign in to comment.