import fs from 'node:fs'
import { parseArgs } from 'node:util'
-import { existsSync, readFileSync } from 'node:fs'
import path from 'node:path'
import { brotliCompressSync, gzipSync } from 'node:zlib'
import pico from 'picocolors'
? `packages-private`
: `packages`
const pkgDir = path.resolve(`${pkgBase}/${target}`)
- const pkg = JSON.parse(readFileSync(`${pkgDir}/package.json`, 'utf-8'))
+ const pkg = JSON.parse(fs.readFileSync(`${pkgDir}/package.json`, 'utf-8'))
// if this is a full build (no specific targets), ignore private packages
if ((isRelease || !targets.length) && pkg.private) {
}
// if building a specific format, do not remove dist.
- if (!formats && existsSync(`${pkgDir}/dist`)) {
+ if (!formats && fs.existsSync(`${pkgDir}/dist`)) {
fs.rmSync(`${pkgDir}/dist`, { recursive: true })
}
* @returns {Promise<void>}
*/
async function checkFileSize(filePath) {
- if (!existsSync(filePath)) {
+ if (!fs.existsSync(filePath)) {
return
}
const file = fs.readFileSync(filePath)