Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/open-next/src/build/edge/createEdgeBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export async function generateEdgeBundle(
additionalExternals: options.config.edgeExternals,
name,
additionalPlugins,
additionalInject: fnOptions.additionalInject,
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/open-next/src/build/generateOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export async function generateOutput(options: BuildOptions) {
Object.entries(config.functions ?? {}).forEach(async ([key, value]) => {
if (value.placement === "global") {
edgeFunctions[key] = {
bundle: `.open-next/functions/${key}`,
bundle: `.open-next/server-functions/${key}`,
handler: indexHandler,
...(await extractOverrideFn(value.override)),
};
Expand Down
9 changes: 9 additions & 0 deletions packages/open-next/src/types/open-next.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReadableStream } from "node:stream/web";

Check failure on line 1 in packages/open-next/src/types/open-next.ts

View workflow job for this annotation

GitHub Actions / validate

format

File content differs from formatting output

import type { Writable } from "node:stream";
import type { WarmerEvent, WarmerResponse } from "../adapters/warmer-function";
Expand Down Expand Up @@ -361,6 +361,15 @@
* @default []
*/
patterns: string[];


/**
* Additional inject code for the function.
* This is used to inject code into the function.
* Used when code needs to be directly injected into the banner section during esbuild. Should be used with caution.
* @default undefined
*/
additionalInject?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the additionalInject option here make that much sense. it would only work for edge bundle.
An option here should work everywhere, not just in edge runtime

}

/**
Expand Down
Loading