Vite plugin v2 - Load local Worker secrets using the Vite mode - #15507
Vite plugin v2 - Load local Worker secrets using the Vite mode#15507jamesopstad wants to merge 1 commit into
Conversation
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| const [localEnv, devVars] = await Promise.all([ | ||
| loadEnv(envDir, localEnvMode), | ||
| loadDevVars(envDir, localEnvMode), | ||
| ]); |
There was a problem hiding this comment.
🟡 Cloudflare tool settings stop loading
When .env defines Cloudflare tool settings, loadEnv keeps them from existing process-based consumers. Remote bindings and other development services then ignore those settings.
Prompt for agents
Preserve support for Cloudflare tool settings loaded from Vite env files without globally copying every local Worker secret into process.env. Audit the consumers that previously relied on the prefixed values copied in resolvePluginConfig, including remote-binding authentication and Cloudflare account, compliance, API, and Hyperdrive settings. Pass the loaded values explicitly where possible, or introduce a narrowly scoped compatibility bridge for the supported tool prefixes. Retain the new localEnv and devVars behavior for Worker secret bindings.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
@jamesopstad Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
Vite plugin v2 - Load local Worker secrets using the Vite mode
.envand.dev.varsresolution and merging now uses the Vite mode and is decoupled from Wrangler.vite previewnow uses themodein the build output to determine which.env/.dev.varsfiles to load. Local secrets in preview are therefore no longer stored in a separate.dev.varsfile.A picture of a cute animal (not mandatory, but encouraged)