mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #315] [MERGED] fix: warn when existing vite.config.ts is missing cloudflare plugin on deploy #473
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#473
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/315
Author: @james-elicx
Created: 3/7/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @james-elicx
Base:
main← Head:fix/issue-312-deploy-vite-config-prereqs📝 Commits (2)
921f706fix: warn when existing vite.config.ts is missing cloudflare plugin on deploy8ce7ad6fix: pages router warning shows cloudflare() not cloudflare(())📊 Changes
3 files changed (+144 additions, -0 deletions)
View changed files
📝
README.md(+24 -0)📝
packages/vinext/src/deploy.ts(+52 -0)📝
tests/deploy.test.ts(+68 -0)📄 Description
Summary
Fixes #312.
Three blockers were reported in the
npm create next-app→npx vinext init→ deploy flow:CLOUDFLARE_API_TOKENpermissions not documentedaccount_idmissing from generatedwrangler.jsonc, with no docs on how to supply itcould not resolve virtual:vinext-rsc-entrybecausevinext initgenerates a minimal local-devvite.config.tswithout@cloudflare/vite-plugin, andvinext deploysilently skips config generation when the file already existsChanges
deploy.ts— addviteConfigHasCloudflarePlugin(): whenvinext deploydetects an existingvite.config.tsthat doesn't import@cloudflare/vite-plugin, it now emits a clear warning with the exact config fix instead of silently proceeding to a broken buildREADME.md— add a "Prerequisites" section to the Cloudflare Workers deployment docs covering:wrangler loginvsCLOUDFLARE_API_TOKEN(with correct "Edit Cloudflare Workers" template permissions), and how to supplyaccount_idtests/deploy.test.ts— 7 new unit tests forviteConfigHasCloudflarePlugin()Testing
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.