Open alexanderniebuhr opened 1 year ago
Also note that it appears there is a move to switch from .toml to .json (Yay! 🥳 ) but when that happens it'll be more complicated and error prone (to support both).
Sure, would love to see exposed APIs for json also. :)
Describe the solution
When using Wrangler in combination with other development servers like Astro, it becomes necessary to read the Wrangler configuration programmatically. Currently, there's no straightforward way to do this, which makes integration cumbersome and less efficient.
I propose exposing the
readConfig
function as a programmatic API. This would allow developers to easily read the Wrangler configuration when using Wrangler programmatically in combination with other tools.wrangler.toml
file: This is error-prone and doesn't account for any internal logic that Wrangler might use to read its configuration, or any added options.This feature would be particularly useful for developers who are using Wrangler in a more complex setup, where multiple development servers or build tools are involved. For example, when using Wrangler with Astro, one could read the Wrangler config to programmatically set up proxying, environment variables, etc.