Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-days-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/cloudflare": patch
---

Clean output directory before `next build`
4 changes: 3 additions & 1 deletion packages/cloudflare/src/cli/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export async function build(
logger.info(`@opennextjs/cloudflare version: ${cloudflare}`);
logger.info(`@opennextjs/aws version: ${aws}`);

// Clean the output directory before building the Next app.
buildHelper.initOutputDir(options);

if (projectOpts.skipNextBuild) {
logger.warn("Skipping Next.js build");
} else {
Expand All @@ -58,7 +61,6 @@ export async function build(

// Generate deployable bundle
printHeader("Generating bundle");
buildHelper.initOutputDir(options);

compileCache(options);
compileEnvFiles(options);
Expand Down