[vite-plugin v1 backport] Support local image URL transformations #17315
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 331 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #17315"
general
weight: 0.35
NuroDev
Backports the remaining Vite integration and regression coverage from #16678. With images.url_transformations enabled, /cdn-cgi/image/ transforms work locally, including Vite public/ files. Disabled transformations return 404 and disallowed origins return 403, as upstream specifies.
Depends on #17293, which already supplies the original Miniflare 5.20261129.0-beta runtime and coupled Wrangler 4.170.0 / workers-utils 0.60.0 graph from #17276. This PR adds no dependency upgrades or absent public source. The upstream runtime implementation and its tests remain in Miniflare. Wrangler's published getMiniflareWorkerOptions already supplies the per-worker image and route-hostname options.
Necessary v1 adaptations: v1 uses V4WorkerOptions and Wrangler snake_case config, so the router receives the equivalent imageUrlTransformations object (enabled / allowedOrigins). The upstream unsafeImageUrlTransformationsFetchViaPublicUrl option is copied directly. The original playground test and PNG are copied unchanged; cloudflare.config.ts is represented by v1's wrangler.jsonc with the equivalent name/date/assets/images fields. No alternate transform implementation is introduced. Wrangler, direct Miniflare and Vitest consumers receive their integration from upstream; this diff completes Vite v1.
Validation: the original playground regression fails before this integration (404 instead of 200) on the already-upgraded runtime and passes afterward in both dev and build/preview (2 tests each). Node 22.22.1 / pnpm 10.33.0: build passes, all 58 check tasks pass, all 8 retained package-test tasks pass including 287 plugin tests. OS and supported Vite matrix CI will validate the published PR head. A plugin minor changeset describes the new capability and intentional local routing behavior change.
---
- [x] Tests included/updated
- [ ] Automated tests not possible - manual testing has been completed as follows:
- [ ] Additional testing not necessary because:
- [ ] Cloudflare docs PR(s):
- [x] Documentation not necessary because: upstream docs follow general availability; the changeset explains local behavior and limitations.
<!-- devin-review-badge-begin -->
---
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17315" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->