Send custom source/source-map pairs

I am trying to use the sentry-cli to send our source bundle/source-map pairs. Our file names do not follow an easily “autodetectable” format. They are of the form:

filename-checksum.js
filename-different-checksum.js.map

As such, I would like to just do something like

sentry-cli files file1 sourcemap1 file2 sourcemap2

Basically, anything where I can just establish the relationship manually. I would prefer not to have to edit filename-checksum.js to include a sourceMapURL that won’t be accessible in production.

We’re currently working on improving the sourcemap upload experience but until then you can achieve your goal this way:

sentry-cli releases files VERSION upload /path/to/index.min.js -H "Sourcemap: index.map" '~/index.min.js'
sentry-cli releases files VERSION upload /path/to/index.map '~/index.map'

The sourcemap header will tell sentry how to get from a minified file to a sourcemap.