diff --git a/server/app.ts b/server/app.ts index e39905866..75c2e7224 100644 --- a/server/app.ts +++ b/server/app.ts @@ -763,12 +763,13 @@ export class Application implements ServerApplication { /** build the application to a static site(SSG) */ async build() { const start = performance.now() - const outputDir = this.outputDir - const distDir = join(outputDir, '_aleph') // wait for app ready await this.ready + const outputDir = this.outputDir + const distDir = join(outputDir, '_aleph') + // clear previous build if (existsDirSync(outputDir)) { for await (const entry of Deno.readDir(outputDir)) {