Skip to content

feat(vite-plugin): allow env override for wrangler config path#13587

Merged
petebacondarwin merged 3 commits intocloudflare:mainfrom
vimtor:vimtor/vite-plugin-config-path-env
Apr 20, 2026
Merged

feat(vite-plugin): allow env override for wrangler config path#13587
petebacondarwin merged 3 commits intocloudflare:mainfrom
vimtor:vimtor/vite-plugin-config-path-env

Conversation

@vimtor
Copy link
Copy Markdown
Contributor

@vimtor vimtor commented Apr 17, 2026

Frameworks like SST might autogenerate wrangler files for deployments.

Currently this requires users to do the following:

import { defineConfig } from "astro/config";
import cloudflare from "@astrojs/cloudflare";

export default defineConfig({
  adapter: cloudflare({
    configPath: process.env.SST_WRANGLER_PATH,
  }),
});

Source from the Astro component.

To make the integration easier, this pull request adds the ability to specify the configPath via the CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH environment variable.

This way, frameworks built on top of Cloudflare can automatically configure wrangler without users needing to change anything.


A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@vimtor vimtor requested a review from workers-devprod as a code owner April 17, 2026 16:49
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 2b89127

The changes in this PR will be included in the next version bump.

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

@workers-devprod workers-devprod requested review from a team and petebacondarwin and removed request for a team April 17, 2026 16:49
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 17, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 17, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13587

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13587

miniflare

npm i https://pkg.pr.new/miniflare@13587

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13587

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13587

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13587

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13587

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13587

wrangler

npm i https://pkg.pr.new/wrangler@13587

commit: 2b89127

@petebacondarwin
Copy link
Copy Markdown
Contributor

Just to be clear, are you suggesting that SST would write its Wrangler config file path into the CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH env var rather than the SST_WRANGLER_PATH env var?

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but getting a second opinion from the rest of the Vite plugin team

@vimtor
Copy link
Copy Markdown
Contributor Author

vimtor commented Apr 18, 2026

Just to be clear, are you suggesting that SST would write its Wrangler config file path into the CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH env var rather than the SST_WRANGLER_PATH env var?

that's right, that way users wouldn't need to specify a configPath in the Vite config

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked with @jamesopstad - we are good to land this

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Apr 20, 2026
@petebacondarwin petebacondarwin merged commit fdb32ca into cloudflare:main Apr 20, 2026
56 of 58 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Apr 20, 2026
@vimtor vimtor deleted the vimtor/vite-plugin-config-path-env branch April 20, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants