mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #711] [MERGED] fix(build): use createBuilder for Pages Router so cloudflare plugin runs #789
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#789
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/711
Author: @james-elicx
Created: 3/29/2026
Status: ✅ Merged
Merged: 3/29/2026
Merged by: @james-elicx
Base:
main← Head:james/fix-pages-wrnagler-config📝 Commits (4)
8284954fix(build): use createBuilder for Pages Router so cloudflare plugin runs75065c1fix environmentscb0d60efix for tests89f1caeanother guard📊 Changes
4 files changed (+65 additions, -63 deletions)
View changed files
📝
examples/pages-router-cloudflare/package.json(+7 -6)📝
packages/vinext/src/cli.ts(+9 -46)📝
packages/vinext/src/deploy.ts(+8 -11)📝
packages/vinext/src/index.ts(+41 -0)📄 Description
fixes #710
The Pages Router build path has used two sequential
vite.build()calls since the initial release, predating Cloudflare support. Whencloudflare()was later added to the example'svite.config.ts, this path was never updated to match.The problem:
cloudflare()'sconfig()hook injects a multi-environment block and abuilder.buildAppoverride. Neither takes effect in a plainvite.build()call, sowriteBundlesees environment name"ssr"or"client"instead of the registered worker environment name, and never writes.wrangler/deploy/config.json.Fix: switch the Pages Router path to
createBuilder+buildApp(), matching the App Router path.cloudflare()now runs its full lifecycle and writes the deploy config itself.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.