From 76af15da53edb418398940369cea4c05696c5af3 Mon Sep 17 00:00:00 2001 From: wkeylin Date: Fri, 7 Jun 2024 15:37:42 +0800 Subject: [PATCH 1/2] fix: get wrong vue version in monorepo --- src/core/options.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/options.ts b/src/core/options.ts index 9a082e67..7c6cc220 100644 --- a/src/core/options.ts +++ b/src/core/options.ts @@ -84,7 +84,9 @@ export function resolveOptions(options: Options, root: string): ResolvedOptions } function getVueVersion(root: string): 2 | 2.7 | 3 { - const raw = getPackageInfoSync('vue', { paths: [root] })?.version || '3' + // To fixed [mlly] issue: https://github.com/unjs/mlly/issues/158 + const fixedRoot = root.endsWith('/') ? root : `${root}/` + const raw = getPackageInfoSync('vue', { paths: [fixedRoot] })?.version || '3' const version = +(raw.split('.').slice(0, 2).join('.')) if (version === 2.7) return 2.7 From cf838072eeaf9e4e87688c8b169cf56c26cf44f7 Mon Sep 17 00:00:00 2001 From: wkeylin Date: Sat, 15 Jun 2024 10:47:50 +0800 Subject: [PATCH 2/2] fix: get wrong vue version in monorepo --- src/core/options.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/options.ts b/src/core/options.ts index 7c6cc220..028d7d03 100644 --- a/src/core/options.ts +++ b/src/core/options.ts @@ -85,8 +85,7 @@ export function resolveOptions(options: Options, root: string): ResolvedOptions function getVueVersion(root: string): 2 | 2.7 | 3 { // To fixed [mlly] issue: https://github.com/unjs/mlly/issues/158 - const fixedRoot = root.endsWith('/') ? root : `${root}/` - const raw = getPackageInfoSync('vue', { paths: [fixedRoot] })?.version || '3' + const raw = getPackageInfoSync('vue', { paths: [join(root, '/')] })?.version || '3' const version = +(raw.split('.').slice(0, 2).join('.')) if (version === 2.7) return 2.7