@appsignal/webpack plugin uploads private sourcemaps during your webpack build. AppSignal uses the sourcemaps to map error backtraces from compiled JavaScript to your original source code.
The plugin supports webpack 4 and 5.
Install the plugin
Install@appsignal/webpack:
Configure webpack
Add
AppsignalPlugin and enable sourcemap generation only in your production webpack configuration. This avoids generating and uploading sourcemaps on every development build.webpack.config.mjs.
APPSIGNAL_PUSH_API_KEYholds your Push API key. Store it as a secret and keep it out of source control and the front-end bundle.APPSIGNAL_APP_NAMEmatches the app name shown in AppSignal.REVISIONmatches therevisionoption in your AppSignal for JavaScript configuration.
urlRoot to the public URL of webpack’s output.path. The plugin appends each sourcemap’s path relative to output.path to urlRoot and removes the .map suffix. For example, if output.filename is "js/[name].js" and webpack emits js/main.js.map, the example registers it for https://example.com/assets/js/main.js. Do not add the js/ subdirectory to urlRoot, or the URL becomes https://example.com/assets/js/js/main.js, which will not match the backtrace.
When webpack emits the build files, the plugin uploads each file whose name ends in .map to AppSignal.