@@ -18,7 +18,6 @@ nr build core --formats cjs
18
18
19
19
import fs from 'node:fs'
20
20
import { parseArgs } from 'node:util'
21
- import { existsSync , readFileSync } from 'node:fs'
22
21
import path from 'node:path'
23
22
import { brotliCompressSync , gzipSync } from 'node:zlib'
24
23
import pico from 'picocolors'
@@ -163,15 +162,15 @@ async function build(target) {
163
162
? `packages-private`
164
163
: `packages`
165
164
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' ) )
167
166
168
167
// if this is a full build (no specific targets), ignore private packages
169
168
if ( ( isRelease || ! targets . length ) && pkg . private ) {
170
169
return
171
170
}
172
171
173
172
// if building a specific format, do not remove dist.
174
- if ( ! formats && existsSync ( `${ pkgDir } /dist` ) ) {
173
+ if ( ! formats && fs . existsSync ( `${ pkgDir } /dist` ) ) {
175
174
fs . rmSync ( `${ pkgDir } /dist` , { recursive : true } )
176
175
}
177
176
@@ -234,7 +233,7 @@ async function checkSize(target) {
234
233
* @returns {Promise<void> }
235
234
*/
236
235
async function checkFileSize ( filePath ) {
237
- if ( ! existsSync ( filePath ) ) {
236
+ if ( ! fs . existsSync ( filePath ) ) {
238
237
return
239
238
}
240
239
const file = fs . readFileSync ( filePath )
0 commit comments