sincecutoff.com
← all changes

datadog-ci sourcemaps inject adds deterministic debug IDs

Introduced 2026-09-11 · score 0.99

HOW TO USE IT

After building JavaScript bundles and sourcemaps, run `datadog-ci sourcemaps inject <build-dir>` before deployment, then upload the same injected artifacts with `datadog-ci sourcemaps upload <build-dir> --debug-id`. Rebuild cleanly after source or build-configuration changes, and keep artifacts unchanged between injection, upload, and deployment.

datadog-ci sourcemaps inject <build-dir>
datadog-ci sourcemaps inject <build-dir> datadog-ci sourcemaps upload <build-dir> --debug-id

WHY THIS HELPS

Prepare built JavaScript bundles and sourcemaps with Debug IDs before deployment and upload.

REQUIREMENTS AND LIMITATIONS

  • Version: v5.24.0
  • <build-dir> (required): Directory containing sourcemaps; the CLI searches recursively for `.js.map` files.
  • --debug-id (required): Upload only bundles that already contain a Debug ID; upload reads the ID from the JavaScript bundle and does not modify build artifacts.
  • --dry-run (inject): Preview injection without modifying files.
  • --max-concurrency (inject): Controls concurrent artifact discovery; the inject documentation does not state a default.
  • Prerequisite: Set `DD_API_KEY` in the environment for sourcemap upload.
  • Prerequisite: Rebuild after source or build-configuration changes so bundles and sourcemaps are recreated without prior injection; a clean build is recommended.
  • Prerequisite: Do not modify generated artifacts between injection, upload, and deployment; regenerate byte-dependent outputs such as SRI hashes or compressed assets after injection.
  • The command modifies JavaScript bundles and sourcemaps in place.
  • Bundles that already contain a debug ID are not reinjected; their sourcemap top-level `debug_id` is still added or corrected to match the bundle.
  • Valid sourcemaps with an empty `mappings` field and their JavaScript bundles are left unchanged and reported as skipped.
  • Upload reads the authoritative ID from the JavaScript bundle; upload matching does not depend on the sourcemap field.
  • After source or build configuration changes, the normal build must recreate bundles and sourcemaps without the previous injection before reinjection; a clean build is recommended.
  • Changed bundle contents receive a new debug ID, while unchanged rebuilt bundles reproduce the same deterministic ID.

FIRST-PARTY EVIDENCE

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

Report a problem with this card