🚀 Feature Request: Load values from wrangler.toml
See original GitHub issueDescribe the solution
A lot of times, I’d like my worker code to depend on some values I have in my wrangler.toml
(e.g. getting the worker name, getting the routes it can be deployed to, etc.)
While I can duplicate this information in JS, it’d be easier if I could just import my wrangler.toml
the same way I can import my package.json
.
We should include a plugin to parse .toml
files with esbuild
(such as esbuild-plugin-toml
so that wrangler publish
can include imports from toml
files.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Configuration · Cloudflare Workers docs
Wrangler optionally uses a wrangler.toml configuration file to customize the development and publishing setup for a Worker.
Read more >🚀 Feature Request: improve the wrangler.toml config ... - GitHub
Describe the solution A feedback that often comes up in various discussions is that the toml config file is not ergonomic, error-prone, ...
Read more >Using the CLI - Miniflare
Fun, full-featured, fully-local simulator for Cloudflare Workers.
Read more >Ditch the Wrangler CLI for Miniflare - LogRocket Blog
To get started with Miniflare, all you need is Node.js and npm: mkdir worker cd worker npm init -y ... Next, move over...
Read more >Troy Hunt on Twitter: "@lxalln Are you sure? Docs say either ...
Worker environment variable I declare in wrangler.toml overwrite the ... Today we're releasing one of the most requested Workers features: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can currently achieve this via a custom build step, so I’m going to close this as not something we should implement in core Wrangler.
We should also be aware that the structure of a wrangler.toml is quite complex with all the inheritance options. So even if you imported this file directly, you might not be reading the correct values depending upon the current environment.