fix(builder): empty buildDir only once by build

This commit is contained in:
Pooya Parsa 2021-02-17 19:32:37 +01:00
parent d63b28303e
commit 7b3244a567

View File

@ -44,6 +44,7 @@ export class Builder {
async function build (builder: Builder) {
const { nuxt } = builder
await fsExtra.emptyDir(nuxt.options.buildDir)
await generate(builder)
if (nuxt.options.dev) {
@ -82,7 +83,6 @@ function watch (builder: Builder) {
export async function generate (builder: Builder) {
const { nuxt } = builder
await fsExtra.emptyDir(nuxt.options.buildDir)
builder.app = await createApp(builder)
const templatesDir = join(builder.nuxt.options.appDir, '_templates')