@@ -2,11 +2,7 @@ import fs from "node:fs";
22import { createRequire } from "node:module" ;
33import path from "node:path" ;
44
5- import type {
6- FunctionOptions ,
7- OpenNextConfig ,
8- SplittedFunctionOptions ,
9- } from "types/open-next" ;
5+ import type { FunctionOptions , SplittedFunctionOptions } from "types/open-next" ;
106
117import logger from "../logger.js" ;
128import { minifyAll } from "../minimize-js.js" ;
@@ -40,9 +36,9 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
4036 const routes = fnOptions . routes ;
4137 routes . forEach ( ( route ) => foundRoutes . add ( route ) ) ;
4238 if ( fnOptions . runtime === "edge" ) {
43- await generateEdgeBundle ( name , config , options , fnOptions ) ;
39+ await generateEdgeBundle ( name , options , fnOptions ) ;
4440 } else {
45- await generateBundle ( name , config , options , fnOptions ) ;
41+ await generateBundle ( name , options , fnOptions ) ;
4642 }
4743 } ) ;
4844
@@ -53,7 +49,7 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
5349
5450 const remainingRoutes = new Set < string > ( ) ;
5551
56- const { monorepoRoot , appBuildOutputPath } = options ;
52+ const { appBuildOutputPath , monorepoRoot } = options ;
5753
5854 const packagePath = path . relative ( monorepoRoot , appBuildOutputPath ) ;
5955
@@ -104,7 +100,7 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
104100 }
105101
106102 // Generate default function
107- await generateBundle ( "default" , config , options , {
103+ await generateBundle ( "default" , options , {
108104 ...defaultFn ,
109105 // @ts -expect-error - Those string are RouteTemplate
110106 routes : Array . from ( remainingRoutes ) ,
@@ -114,11 +110,11 @@ export async function createServerBundle(options: buildHelper.BuildOptions) {
114110
115111async function generateBundle (
116112 name : string ,
117- config : OpenNextConfig ,
118113 options : buildHelper . BuildOptions ,
119114 fnOptions : SplittedFunctionOptions ,
120115) {
121- const { appPath, appBuildOutputPath, outputDir, monorepoRoot } = options ;
116+ const { appPath, appBuildOutputPath, config, outputDir, monorepoRoot } =
117+ options ;
122118 logger . info ( `Building server function: ${ name } ...` ) ;
123119
124120 // Create output folder
0 commit comments