Skip to content

Commit

Permalink
Add mentions of wrangler.jsonc (#18488)
Browse files Browse the repository at this point in the history
Co-authored-by: ToriLindsay <[email protected]>
  • Loading branch information
meyer and ToriLindsay authored Jan 6, 2025
1 parent 2cd2846 commit 04e139f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If we require more information to address your pull request, the `more-informati

## Wrangler config

If you're adding a code snippet to the docs that represents a Wrangler config file (`wrangler.toml` or `wrangler.json`) make sure you wrap it with the `<WranglerConfig>` component, which ensure it's rendered as both JSON and TOML e.g.
If you're adding a code snippet to the docs that represents a Wrangler config file (`wrangler.toml`, `wrangler.json`, or `wrangler.jsonc`) make sure you wrap it with the `<WranglerConfig>` component, which ensure it's rendered as both JSON and TOML e.g.

````
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/wrangler/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const platform = await getPlatformProxy(options);

- `experimentalJsonConfig` boolean

If `true`, allows the utility to read a JSON config file (for example, `wrangler.json`).
If `true`, allows the utility to read a JSON config file (for example, `wrangler.json` or `wrangler.jsonc`).

- `persist` boolean | `{ path: string }`

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/workers/wrangler/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ description: Use a configuration file to customize the

import { Render, Type, MetaInfo } from "~/components";

Wrangler optionally uses a `wrangler.json`/`wrangler.toml` file to customize the development and deployment setup for a Worker.
Wrangler optionally uses a `wrangler.json`/`wrangler.jsonc`/`wrangler.toml` file to customize the development and deployment setup for a Worker.

:::note

As of Wrangler v3.91.0, Wrangler supports both JSON (`wrangler.json`) and TOML (`wrangler.toml`) for its configuration file. Prior to that version, only `wrangler.toml` was supported. The format of Wrangler's configuration file is exactly the same across both languages, except that the syntax is `JSON` rather than `TOML`. Throughout this page and the rest of Cloudflare's documentation config snippets are provided as both JSON and TOML.
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. The format of Wrangler's configuration file is exactly the same across both languages, except that the syntax is `JSON` rather than `TOML`. Throughout this page and the rest of Cloudflare's documentation config snippets are provided as both JSON and TOML.

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ The following global flags work on every command:
- Show version number.
- `--config` <Type text="string" /> (not supported by Pages)
- Path to `.toml` configuration file.
- `--experimental-json-config` <Type text="boolean" /> (not supported by Pages)
- ⚠️ This is an experimental command. Read configuration from a `wrangler.json` or `wrangler.jsonc` file, instead of `wrangler.toml`. In this case the config file is parsed as [JSONC](https://code.visualstudio.com/docs/languages/json#_json-with-comments).

0 comments on commit 04e139f

Please sign in to comment.