If you are using Honeybadger for JS error monitoring on your Rails app, you may want to upload source maps so they can be applied to JS stack traces.
Here’s how you can do that if you are using esbuild, Sprockets, and deploying to Heroku. The source map will be uploaded to Honeybadger during the build phase, via a Rake task enhancing the assets:precompile step.
assets:precompile
{ "name": "app", "private": true, "dependencies": { "esbuild": "^0.22" }, "scripts": { "build": "node esbuild.config.mjs" } }
This is a truncated example, only showing the esbuild dependency and build script.
esbuild