workers-sdk
workers-sdk copied to clipboard
🚀 Feature Request: Custom path for env files
trafficstars
Describe the solution
The undocumented .dev.vars file is really handy to populate secrets in local mode, since you do not need to modify the toml file.
Most projects use a .env file that is not checked in to read environment variables locally. In order to use the same variables for Wrangler, you would need to copy the variables you need for the worker from the .env file to the .dev.vars file. It would be nice to use the .env instead. This could be solved by supporting a custom path that for dotenv.
Miniflare supports custom env file paths through the --env flag or a env_path entry in the wrangler.toml (nice for different environments). It would be nice to see a similar API in wrangler.