From 356a57374ccf08d587fd66385c5a66094fc54839 Mon Sep 17 00:00:00 2001 From: Dorseuil Nicolas Date: Tue, 12 Mar 2024 12:32:02 +0100 Subject: [PATCH] fix monorepo --- packages/open-next/src/build/createServerBundle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/open-next/src/build/createServerBundle.ts b/packages/open-next/src/build/createServerBundle.ts index eba4bbea..1f6e9d8a 100644 --- a/packages/open-next/src/build/createServerBundle.ts +++ b/packages/open-next/src/build/createServerBundle.ts @@ -122,7 +122,6 @@ async function generateBundle( // Create output folder const outputPath = path.join(outputDir, "server-functions", name); - fs.mkdirSync(outputPath, { recursive: true }); // Resolve path to the Next.js app if inside the monorepo // note: if user's app is inside a monorepo, standalone mode places @@ -131,6 +130,7 @@ async function generateBundle( // We need to output the handler file inside the package path. const isMonorepo = monorepoRoot !== appPath; const packagePath = path.relative(monorepoRoot, appBuildOutputPath); + fs.mkdirSync(path.join(outputPath, packagePath), { recursive: true }); fs.copyFileSync( path.join(outputDir, ".build", "cache.cjs"),