build: fix build script
This commit is contained in:
parent
3db69af53d
commit
681775a13c
|
@ -91,7 +91,7 @@ async function build(target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if building a specific format, do not remove dist.
|
// if building a specific format, do not remove dist.
|
||||||
if (!formats) {
|
if (!formats && existsSync(`${pkgDir}/dist`)) {
|
||||||
await fs.rm(`${pkgDir}/dist`, { recursive: true })
|
await fs.rm(`${pkgDir}/dist`, { recursive: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ function checkFileSize(filePath) {
|
||||||
const gzipped = gzipSync(file)
|
const gzipped = gzipSync(file)
|
||||||
const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
|
const gzippedSize = (gzipped.length / 1024).toFixed(2) + 'kb'
|
||||||
const compressed = compress(file)
|
const compressed = compress(file)
|
||||||
const compressedSize = (compressed.length / 1024).toFixed(2) + 'kb'
|
const compressedSize = (compressed?.length || 0 / 1024).toFixed(2) + 'kb'
|
||||||
console.log(
|
console.log(
|
||||||
`${chalk.gray(
|
`${chalk.gray(
|
||||||
chalk.bold(path.basename(filePath))
|
chalk.bold(path.basename(filePath))
|
||||||
|
|
Loading…
Reference in New Issue