Skip to content

Commit

Permalink
fix: unlink before cleaning up dist dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 30, 2021
1 parent 299bdd6 commit c8cb2b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/make.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import globby from 'globby'
import { resolve, extname, join, basename, dirname } from 'upath'
import { emptyDir, mkdirp, copyFile, readFile, writeFile } from 'fs-extra'
import { emptyDir, mkdirp, copyFile, readFile, writeFile, unlink } from 'fs-extra'
import { InputFile, CreateLoaderOptions, createLoader } from './loader'

interface mkdistOptions {
Expand All @@ -17,6 +17,7 @@ export async function mkdist (options: mkdistOptions /* istanbul ignore next */
options.distDir = resolve(options.rootDir, options.distDir || 'dist')

// Setup dist
await unlink(options.distDir).catch(() => {})
await emptyDir(options.distDir)
await mkdirp(options.distDir)

Expand Down

0 comments on commit c8cb2b8

Please sign in to comment.