sincecutoff.com
← all changes

wrangler deploy and versions upload accept a positional path

Introduced 2026-06-05 · score 0.97

HOW TO USE IT

If deploying a Worker entry point or static asset directory, pass its path positionally to `wrangler deploy` or `wrangler versions upload`; Wrangler treats it as the entry point or assets directory. For directory deployments, the release note says the positional path avoids an interactive confirmation prompt.

npx wrangler deploy ./src/index.ts
npx wrangler deploy ./public
npx wrangler versions upload <path>

WHY THIS HELPS

Deploy a Worker entry point or a directory of static assets using Wrangler.

BEFORE THIS CHANGE

Use `--script` for a Worker file; the positional argument was `[script]`.

REQUIREMENTS AND LIMITATIONS

  • Version: 4.98.0
  • [PATH]: Path to a Worker entry point or static assets directory. Required for a Worker when the Wrangler config has no `main` key. For static assets, overrides configured assets and is equivalent to `--assets`.
  • --assets <directory>: Folder of static assets to serve; equivalent to passing the assets directory as the positional path.
  • --script: Release note says this option is hidden and deprecated, remains for backwards compatibility, and accepts file paths only.
  • `--script` remains available for backwards compatibility but only accepts file paths.
  • Passing a directory to `--script` produces an error suggesting the positional `path` argument or `--assets` flag.
  • Docs conflict: Current Wrangler docs say positional asset paths work only in interactive mode, conflicting with the release note's statement that directory deployment avoids an interactive confirmation prompt. Current docs may describe a newer version: https://developers.cloudflare.com/workers/wrangler/commands/workers/

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card