-
Notifications
You must be signed in to change notification settings - Fork 166
Fix edge functions bundle path #926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update bundle path from .open-next/functions to .open-next/server-functions to match the actual build output location for edge functions
Add additionalInject: fnOptions.additionalInject for injecting code directly into the banner section during esbuild. Use with caution.
Improve JSDoc comment to clarify usage for esbuild banner injection and add caution note for safe usage
🦋 Changeset detectedLatest commit: fba7bab The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
* Used when code needs to be directly injected into the banner section during esbuild. Should be used with caution. | ||
* @default undefined | ||
*/ | ||
additionalInject?: string; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty to update the PR.
Regarding the additionalInject
that I removed, if you still need this i'd rather have another PR. And i don't think it should be done this way
Summary
This PR includes two main improvements to the OpenNext edge functions handling:
Fix edge functions bundle path: Corrects the bundle path from
.open-next/functions
to.open-next/server-functions
to match the actual build output location.Add additionalInject option support: Introduces a new
additionalInject
option for injecting custom code directly into the esbuild banner section.Changes
generateOutput.ts
to use the correct server-functions directoryadditionalInject
option support increateEdgeBundle.ts
additionalInject
option with usage guidelines and caution notesBreaking Changes
None. These changes are backward compatible.
Notes
additionalInject
option should be used with caution as it directly injects code into the esbuild banner sectionTesting