Repository navigation
Generate source maps by default for Vite plugin Workers and Build Output - #16245
Merged
Merged
Conversation
`wrangler build --experimental-cf-build-output` (and the `cf-wrangler` build delegate used by `cf`) only emitted source maps when `upload_source_maps = true`. It now uses the same best-effort default as `wrangler deploy` and `wrangler versions upload`: source maps are generated and listed in the Build Output manifest, unresolvable ones are skipped, and `upload_source_maps = false` opts out.
Vite leaves `build.sourcemap` off by default, so Worker builds never emitted source maps and neither Build Output nor the generated `wrangler.json` had any to upload. Worker environments now default `build.sourcemap` to `true` unless the user sets it (per-environment or top-level) or sets `upload_source_maps` in the Worker config. Only Worker environments are affected, so no source maps end up in public client assets.
🦋 Changeset detectedLatest commit: 5d108f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
workers-devprod
requested review from
a team and
jamesopstad
and removed request for
a team
October 13, 2026 15:46
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
Contributor
|
LGTM! |
dario-piotrowicz
requested review from
dario-piotrowicz
and removed request for
jamesopstad
October 13, 2026 15:51
dario-piotrowicz
approved these changes
Oct 13, 2026
workers-devprod
approved these changes
Oct 13, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
WalshyDev
enabled auto-merge (squash)
October 13, 2026 16:06
Merged
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Oct 17, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `wrangler` | 4.150.0 | 4.151.0 | minor | ## Release Notes <details> <summary><b>wrangler</b> (4.150.0 → 4.151.0)</summary> ### Minor Changes - [#16245](cloudflare/workers-sdk#16245) [`d6b1c82`](cloudflare/workers-sdk@d6b1c82) Thanks [@<!---->WalshyDev](https://github.com/WalshyDev)! - Include source maps by default in `wrangler build --experimental-cf-build-output` Build Output now matches `wrangler deploy` and `wrangler versions upload`, which upload source maps by default, so Workers built for tools like `cf` get stack traces that point at the original source. Source maps that can't be resolved are skipped rather than failing the build. Set `upload_source_maps = false` to opt out. ### Patch Changes - [#16220](cloudflare/workers-sdk#16220) [`97b2fb1`](cloudflare/workers-sdk@97b2fb1) Thanks [@<!---->FlorentCollin](https://github.com/FlorentCollin)! - Support local D1 queries through the experimental `d1_binding_jsrpc` compatibility flag Local D1 bindings now implement the RPC query backend used by `D1Database.query()` and prepared-statement methods when the flag is enabled. Queries reuse local SQLite execution, including transactional batches, execution metadata, and session bookmarks, while bindings without the flag continue to use HTTP. Update the bundled workerd runtime to `1.20261012.1` and align the default compatibility date with that release. - Updated dependencies [[`f360829`](cloudflare/workers-sdk@f360829), [`97b2fb1`](cloudflare/workers-sdk@97b2fb1), [`97b2fb1`](cloudflare/workers-sdk@97b2fb1), [`acd2822`](cloudflare/workers-sdk@acd2822)]: - miniflare@5.20261012.0-beta </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 task
WalshyDev
added a commit
to cloudflare/cloudflare-docs
that referenced
this pull request
Oct 19, 2026
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
2 tasks done
WalshyDev
added a commit
to cloudflare/cloudflare-docs
that referenced
this pull request
Oct 19, 2026
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
WalshyDev
added a commit
to cloudflare/cloudflare-docs
that referenced
this pull request
Oct 19, 2026
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
WalshyDev
added a commit
to cloudflare/cloudflare-docs
that referenced
this pull request
Oct 20, 2026
Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
meefs
pushed a commit
to meefs/cloudflare-docs
that referenced
this pull request
Oct 21, 2026
…34245) Wrangler now generates and uploads source maps by default for `wrangler deploy`, `wrangler versions upload` and `wrangler preview` (cloudflare/workers-sdk#16231). The Cloudflare Vite plugin and Wrangler's Build Output now also generate source maps by default (cloudflare/workers-sdk#16245), so `cf deploy`, which uploads every source map in the build output, gets them without configuration too. Update the source maps, configuration and cf migration docs to describe the new defaults, the lenient handling of unresolvable maps, and how to opt out with Wrangler and with cf, and add a changelog entry announcing it.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #16231, which turned source map uploads on by default for
wrangler deploy,wrangler versions uploadandwrangler preview. Two build paths still don't produce source maps by default, so there's nothing to upload from them. One of those is the pathcfuses.build.sourcemapoff by default, so Worker builds never emitted maps. Worker environments now default it totrueunless the user setsbuild.sourcemap(per environment or at the top level) or setsupload_source_mapsin the Worker config. The client environment isn't affected, so no maps end up in public assets.wrangler build --experimental-cf-build-output(and thecf-wranglerbuild delegate): only included source maps whenupload_source_maps = true. It now uses the same default as deploy. Maps it can't resolve are skipped instead of failing the build, andupload_source_maps = falseopts out.build.sourcemapexplicitly are still correct; they can be simplified in a follow-up