Skip to content

Commit

Permalink
fix: get wrong vue version in monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
wkeylin committed Jun 15, 2024
1 parent 76af15d commit cf83807
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf83807

Please sign in to comment.