@@ -2,11 +2,7 @@ import fs from "node:fs";
2
2
import { createRequire } from "node:module" ;
3
3
import path from "node:path" ;
4
4
5
- import type {
6
- FunctionOptions ,
7
- OpenNextConfig ,
8
- SplittedFunctionOptions ,
9
- } from "types/open-next" ;
5
+ import type { FunctionOptions , SplittedFunctionOptions } from "types/open-next" ;
10
6
11
7
import logger from "../logger.js" ;
12
8
import { minifyAll } from "../minimize-js.js" ;
@@ -40,9 +36,9 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
40
36
const routes = fnOptions . routes ;
41
37
routes . forEach ( ( route ) => foundRoutes . add ( route ) ) ;
42
38
if ( fnOptions . runtime === "edge" ) {
43
- await generateEdgeBundle ( name , config , options , fnOptions ) ;
39
+ await generateEdgeBundle ( name , options , fnOptions ) ;
44
40
} else {
45
- await generateBundle ( name , config , options , fnOptions ) ;
41
+ await generateBundle ( name , options , fnOptions ) ;
46
42
}
47
43
} ) ;
48
44
@@ -53,7 +49,7 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
53
49
54
50
const remainingRoutes = new Set < string > ( ) ;
55
51
56
- const { monorepoRoot , appBuildOutputPath } = options ;
52
+ const { appBuildOutputPath , monorepoRoot } = options ;
57
53
58
54
const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
59
55
@@ -104,7 +100,7 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
104
100
}
105
101
106
102
// Generate default function
107
- await generateBundle ( "default" , config , options , {
103
+ await generateBundle ( "default" , options , {
108
104
...defaultFn ,
109
105
// @ts -expect-error - Those string are RouteTemplate
110
106
routes : Array . from ( remainingRoutes ) ,
@@ -114,11 +110,11 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
114
110
115
111
async function generateBundle (
116
112
name : string ,
117
- config : OpenNextConfig ,
118
113
options : buildHelper . BuildOptions ,
119
114
fnOptions : SplittedFunctionOptions ,
120
115
) {
121
- const { appPath, appBuildOutputPath, outputDir, monorepoRoot } = options ;
116
+ const { appPath, appBuildOutputPath, config, outputDir, monorepoRoot } =
117
+ options ;
122
118
logger . info ( `Building server function: ${ name } ...` ) ;
123
119
124
120
// Create output folder
0 commit comments