Skip to content

Commit 0d57c11

Browse files
Clean output directory before build to prevent recursive bundling (#953)
* fix: init outDir before building next to fix recursive build [Issue Link](https://github.com/szcharlesji/opennext-error-reproduction) * Create soft-queens-sing.md --------- Co-authored-by: conico974 <[email protected]>
1 parent 042dfd9 commit 0d57c11

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/soft-queens-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
Clean output directory before `next build`

packages/open-next/src/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ export async function build(
5353
// Build Next.js app
5454
printHeader("Building Next.js app");
5555
setStandaloneBuildMode(options);
56+
buildHelper.initOutputDir(options);
5657
buildNextjsApp(options);
5758

5859
// Generate deployable bundle
5960
printHeader("Generating bundle");
60-
buildHelper.initOutputDir(options);
6161

6262
// Compile cache.ts
6363
compileCache(options);

0 commit comments

Comments
 (0)