Skip to content

Commit

Permalink
feat: resolve complier from peer dep when unable to resolve from the …
Browse files Browse the repository at this point in the history
…root (#68)

Co-authored-by: luolei <luolei@kuaishou.com>
  • Loading branch information
rorry121 and luolei committed Nov 29, 2022
1 parent b8e6133 commit 0ea62d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler.ts
Expand Up @@ -10,7 +10,7 @@ import type * as _compiler from 'vue/compiler-sfc'

export function resolveCompiler(root: string): typeof _compiler {
// resolve from project root first, then fallback to peer dep (if any)
const compiler = tryRequire('vue/compiler-sfc', root)
const compiler = tryRequire('vue/compiler-sfc', root) || tryRequire('vue/compiler-sfc')

if (!compiler) {
throw new Error(
Expand Down

0 comments on commit 0ea62d2

Please sign in to comment.