build: only remove dist directory when building all formats
This commit is contained in:
parent
d7eab51315
commit
3ec63dbee1
@ -54,7 +54,10 @@ async function build(target) {
|
||||
const pkgDir = path.resolve(`packages/${target}`)
|
||||
const pkg = require(`${pkgDir}/package.json`)
|
||||
|
||||
await fs.remove(`${pkgDir}/dist`)
|
||||
// if building a specific format, do not remove dist.
|
||||
if (!formats) {
|
||||
await fs.remove(`${pkgDir}/dist`)
|
||||
}
|
||||
|
||||
const env =
|
||||
(pkg.buildOptions && pkg.buildOptions.env) ||
|
||||
|
Loading…
Reference in New Issue
Block a user