mirror of https://github.com/vuejs/core.git
chore(benchmark): fix path
This commit is contained in:
parent
ced7ee684c
commit
c065aaff0b
|
@ -3,19 +3,22 @@ import fs from 'node:fs'
|
|||
import pico from 'picocolors'
|
||||
import { createRequire } from 'node:module'
|
||||
import { spawn } from 'node:child_process'
|
||||
import path from 'node:path'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const packagesPath = path.resolve(import.meta.dirname, '../packages')
|
||||
|
||||
export const targets = fs
|
||||
.readdirSync('packages')
|
||||
.readdirSync(packagesPath)
|
||||
.filter(f => {
|
||||
const folder = path.resolve(packagesPath, f)
|
||||
if (
|
||||
!fs.statSync(`packages/${f}`).isDirectory() ||
|
||||
!fs.existsSync(`packages/${f}/package.json`)
|
||||
!fs.statSync(folder).isDirectory() ||
|
||||
!fs.existsSync(`${folder}/package.json`)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
const pkg = require(`../packages/${f}/package.json`)
|
||||
const pkg = require(`${folder}/package.json`)
|
||||
if (pkg.private && !pkg.buildOptions) {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue