Skip to content

Commit

Permalink
fix: let end user of presta handle output dir cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehwagz committed Mar 1, 2022
1 parent 32becb3 commit b4132d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-suns-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'presta': patch
---

Let end user of presta handle output directory removal instead of automatically removing the output directory
7 changes: 1 addition & 6 deletions packages/presta/lib/__tests__/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ test('buildCommand', async () => {
plan++
},
},
'fs-extra': {
emptyDirSync() {
plan++
},
},
'./build': {
build() {
plan++
Expand All @@ -44,7 +39,7 @@ test('buildCommand', async () => {

await buildCommand({})

assert.equal(plan, 6)
assert.equal(plan, 5)
})

test('devCommand', async () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/presta/lib/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import fs from 'fs-extra'
import path from 'path'
import chokidar from 'chokidar'

Expand Down Expand Up @@ -37,8 +36,6 @@ export async function buildCommand(options: PrestaCLIBuildOptions) {
const config = create(Env.PRODUCTION, { ...options, port }, configFile)
await initPlugins(config.plugins, config, hooks)

fs.emptyDirSync(config.output)

logger.info({
label: 'build',
})
Expand Down

0 comments on commit b4132d5

Please sign in to comment.