Skip to content

Commit

Permalink
fix(build): use rimraf to handle temp folder deletion in windows (#2483)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Jun 7, 2023
1 parent 2bd55ec commit 2f75769
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/node/build/build.ts
@@ -1,16 +1,17 @@
import fs from 'fs-extra'
import path from 'path'
import { createRequire } from 'module'
import ora from 'ora'
import path from 'path'
import { packageDirectorySync } from 'pkg-dir'
import { rimraf } from 'rimraf'
import type { OutputAsset, OutputChunk } from 'rollup'
import { pathToFileURL } from 'url'
import type { BuildOptions } from 'vite'
import type { OutputChunk, OutputAsset } from 'rollup'
import { resolveConfig } from '../config'
import { renderPage } from './render'
import { bundle, okMark, failMark } from './bundle'
import { createRequire } from 'module'
import { pathToFileURL } from 'url'
import { packageDirectorySync } from 'pkg-dir'
import { serializeFunctions } from '../utils/fnSerialize'
import type { HeadConfig } from '../shared'
import { serializeFunctions } from '../utils/fnSerialize'
import { bundle, failMark, okMark } from './bundle'
import { renderPage } from './render'

export async function build(
root?: string,
Expand Down Expand Up @@ -142,8 +143,7 @@ export async function build(
)
} finally {
unlinkVue()
if (!process.env.DEBUG)
fs.rmSync(siteConfig.tempDir, { recursive: true, force: true })
if (!process.env.DEBUG) await rimraf(siteConfig.tempDir)
}

await siteConfig.buildEnd?.(siteConfig)
Expand Down

0 comments on commit 2f75769

Please sign in to comment.