File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
packages/open-next/src/build Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export function createCacheAssets(options: buildHelper.BuildOptions) {
6161 logger . info ( "Bundling cache assets..." ) ;
6262
6363 const { appBuildOutputPath, outputDir } = options ;
64- const packagePath = path . relative ( options . monorepoRoot , appBuildOutputPath ) ;
64+ const packagePath = buildHelper . getPackagePath ( options ) ;
6565 const buildId = buildHelper . getBuildId ( appBuildOutputPath ) ;
6666 let useTagCache = false ;
6767
Original file line number Diff line number Diff line change @@ -47,18 +47,14 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
4747
4848 const remainingRoutes = new Set < string > ( ) ;
4949
50- const { appBuildOutputPath, monorepoRoot } = options ;
51-
52- const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
50+ const { appBuildOutputPath } = options ;
5351
5452 // Find remaining routes
5553 const serverPath = path . join (
5654 appBuildOutputPath ,
57- ".next" ,
58- "standalone" ,
59- packagePath ,
60- ".next" ,
61- "server" ,
55+ ".next/standalone" ,
56+ buildHelper . getPackagePath ( options ) ,
57+ ".next/server" ,
6258 ) ;
6359
6460 // Find app dir routes
@@ -118,7 +114,7 @@ async function generateBundle(
118114 // `node_modules` inside `.next/standalone`, and others inside
119115 // `.next/standalone/package/path` (ie. `.next`, `server.js`).
120116 // We need to output the handler file inside the package path.
121- const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
117+ const packagePath = buildHelper . getPackagePath ( options ) ;
122118 fs . mkdirSync ( path . join ( outputPath , packagePath ) , { recursive : true } ) ;
123119
124120 const ext = fnOptions . runtime === "deno" ? "mjs" : "cjs" ;
Original file line number Diff line number Diff line change @@ -389,3 +389,7 @@ export async function isEdgeRuntime(
389389 }
390390 return ( await overrides ?. wrapper ?.( ) ) ?. edgeRuntime ;
391391}
392+
393+ export function getPackagePath ( options : BuildOptions ) {
394+ return path . relative ( options . monorepoRoot , options . appBuildOutputPath ) ;
395+ }
You can’t perform that action at this time.
0 commit comments