@@ -18,7 +18,6 @@ nr build core --formats cjs
1818
1919import fs from 'node:fs'
2020import { parseArgs } from 'node:util'
21- import { existsSync , readFileSync } from 'node:fs'
2221import path from 'node:path'
2322import { brotliCompressSync , gzipSync } from 'node:zlib'
2423import pico from 'picocolors'
@@ -163,15 +162,15 @@ async function build(target) {
163162 ? `packages-private`
164163 : `packages`
165164 const pkgDir = path . resolve ( `${ pkgBase } /${ target } ` )
166- const pkg = JSON . parse ( readFileSync ( `${ pkgDir } /package.json` , 'utf-8' ) )
165+ const pkg = JSON . parse ( fs . readFileSync ( `${ pkgDir } /package.json` , 'utf-8' ) )
167166
168167 // if this is a full build (no specific targets), ignore private packages
169168 if ( ( isRelease || ! targets . length ) && pkg . private ) {
170169 return
171170 }
172171
173172 // if building a specific format, do not remove dist.
174- if ( ! formats && existsSync ( `${ pkgDir } /dist` ) ) {
173+ if ( ! formats && fs . existsSync ( `${ pkgDir } /dist` ) ) {
175174 fs . rmSync ( `${ pkgDir } /dist` , { recursive : true } )
176175 }
177176
@@ -234,7 +233,7 @@ async function checkSize(target) {
234233 * @returns {Promise<void> }
235234 */
236235async function checkFileSize ( filePath ) {
237- if ( ! existsSync ( filePath ) ) {
236+ if ( ! fs . existsSync ( filePath ) ) {
238237 return
239238 }
240239 const file = fs . readFileSync ( filePath )
0 commit comments