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) {
61
61
logger . info ( "Bundling cache assets..." ) ;
62
62
63
63
const { appBuildOutputPath, outputDir } = options ;
64
- const packagePath = path . relative ( options . monorepoRoot , appBuildOutputPath ) ;
64
+ const packagePath = buildHelper . getPackagePath ( options ) ;
65
65
const buildId = buildHelper . getBuildId ( appBuildOutputPath ) ;
66
66
let useTagCache = false ;
67
67
Original file line number Diff line number Diff line change @@ -47,18 +47,14 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
47
47
48
48
const remainingRoutes = new Set < string > ( ) ;
49
49
50
- const { appBuildOutputPath, monorepoRoot } = options ;
51
-
52
- const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
50
+ const { appBuildOutputPath } = options ;
53
51
54
52
// Find remaining routes
55
53
const serverPath = path . join (
56
54
appBuildOutputPath ,
57
- ".next" ,
58
- "standalone" ,
59
- packagePath ,
60
- ".next" ,
61
- "server" ,
55
+ ".next/standalone" ,
56
+ buildHelper . getPackagePath ( options ) ,
57
+ ".next/server" ,
62
58
) ;
63
59
64
60
// Find app dir routes
@@ -118,7 +114,7 @@ async function generateBundle(
118
114
// `node_modules` inside `.next/standalone`, and others inside
119
115
// `.next/standalone/package/path` (ie. `.next`, `server.js`).
120
116
// We need to output the handler file inside the package path.
121
- const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
117
+ const packagePath = buildHelper . getPackagePath ( options ) ;
122
118
fs . mkdirSync ( path . join ( outputPath , packagePath ) , { recursive : true } ) ;
123
119
124
120
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(
389
389
}
390
390
return ( await overrides ?. wrapper ?.( ) ) ?. edgeRuntime ;
391
391
}
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