From 5b94a1bd8bdd145b919b11150ba270c42e5a896c Mon Sep 17 00:00:00 2001 From: luolei Date: Sun, 27 Nov 2022 22:24:54 +0800 Subject: [PATCH] feat: resolve complier from peer dep when unable to resolve from the root --- src/compiler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler.ts b/src/compiler.ts index 37e4503..3f05f11 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -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(