Revamp static assets#26
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f6b9f4a08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ` ${JSON.stringify(routePath)}: {\n GET: new Response(Bun.file(${JSON.stringify( | ||
| filePath | ||
| )})${responseOptions}),\n HEAD: new Response(Bun.file(${JSON.stringify( |
There was a problem hiding this comment.
Generate handler routes instead of static Bun.file responses
getStaticAssetRoutesFileContent currently emits GET/HEAD entries as new Response(Bun.file(...)) static route values, which crashes server startup on Bun 1.2.x with TODOError: support Bun.file(path) in static routes (I reproduced this locally with Bun v1.2.14 using the same route shape). This means apps adopting this commit cannot boot in environments still on that Bun line; generating per-method handler functions that return new Response(Bun.file(...)) avoids the unsupported static-route code path while preserving behavior.
Useful? React with 👍 / 👎.
No description provided.