Skip to content

Conversation

@ryanlua
Copy link

@ryanlua ryanlua commented Jul 5, 2025

Updates the Wrangler configuration from TOML to JSON or specifically, JSON with comments (.jsonc). Cloudflare recommends wrangler.jsonc over wrangler.toml in their official documentation. This PR just updates to the configuration to use the recommended file format from Cloudflare.

From Cloudflare's documentation:

As of Wrangler v3.91.0 Wrangler supports both JSON (wrangler.json or wrangler.jsonc) and TOML (wrangler.toml) for its configuration file. Prior to that version, only wrangler.toml was supported.

Cloudflare recommends using wrangler.jsonc for new projects.

The format of Wrangler's configuration file is exactly the same across both languages, only the syntax differs.

You can use one of the many available online converters to easily switch between the two.

Throughout this page and the rest of Cloudflare's documentation, configuration snippets are provided as both JSON and TOML.

https://developers.cloudflare.com/workers/wrangler/configuration/

Notes

There is no secrets key equivalent anymore in the Wrangler configuration. The closest would be the vars non-inheritable key but those are only for environment variables and not secrets such as your Discord bot token. It is easy to accidentally commit your secrets because there's no way to .gitignore just the vars key in a JSON. I've removed the keys that include secrets, but they can be added back into using this:

{
//   "vars": {
//     "DISCORD_TOKEN": "..",
//     "DISCORD_PUBLIC_KEY": "..",
//     "DISCORD_APPLICATION_ID": ".."
//   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant