We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The below should output dev not sandbox as the .env file should override the wrangler variables. This happens only in v2. v1 is fine.
dev
sandbox
wrangler.toml:
name = "test" type = "javascript" [build.upload] format = "modules" main = "./index.mjs" [env.dev] account_id = "-REDACTED-" zone_id = "-REDACTED-" workers_dev = true [env.dev.vars] ENV = "sandbox"
.env
ENV=dev
Test script:
interface Env { ENV: string } export default { async fetch(request: Request, env: Env, ctx: ExecutionContext) { console.log(env.ENV) return new Response(null, { status: 404 }) } }
Miniflare command:
miniflare -w -m --wrangler-env "dev" --env ".env"
Output:
The text was updated successfully, but these errors were encountered:
Move .env file parsing code to end. Fixes cloudflare#75
381e2de
Moved the .env file parsing code to the end of the method so that it overrides WASM variables
Merge pull request #76 from payellodevsupport/patch-1
6c59d92
Move .env file parsing code to end. Fixes #75
7cbaaa1
No branches or pull requests
The below should output
dev
notsandbox
as the .env file should override the wrangler variables.This happens only in v2. v1 is fine.
wrangler.toml:
.env
Test script:
Miniflare command:
Output:
The text was updated successfully, but these errors were encountered: