EAS Workflows deploy job: export web with source maps, or a hook between export and deploy
Jakub Hanko
The pre-packaged
type: deploy
job runs expo export
and eas deploy
in one go. Its hooks (after_checkout
, before_install_node_modules
, after_install_node_modules
) all run before the export, so there is no place to work with the exported files before they are deployed.We need that place to upload web source maps to Sentry.
expo export --source-maps
with Sentry's Metro plugin already writes debug IDs into the web bundles and their maps; all that's missing is a step that runs sentry-cli sourcemaps upload dist
and then removes the .map
files so they aren't published. The same applies to any error tracker (Bugsnag, Datadog, PostHog) and to other post-export steps.The
source_maps
param doesn't cover this: it passes --source-maps
to eas deploy
, which only includes server source maps. For web.output: 'static'
or 'single'
it does nothing, and the export itself still runs without --source-maps
.Today the only option is to replace
type: deploy
with a custom job (eas/checkout
, eas/install_node_modules
, expo export --source-maps
, upload, delete maps, then eas/deploy
). That works, but eas/deploy
isn't documented, and we lose future improvements to the managed job.Any of these would let us go back to
type: deploy
:- An after_export(orbefore_deploy) hook, run with the export indist.
- A param to export with source maps, plus upload_sentry_sourcemapslike theupdatejob has (upload, then strip the maps before deploying).
- Documenting eas/exportandeas/deployas step functions for custom jobs.