Skip to main content
The @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.
The webpack plugin is in beta. Report bugs in the AppSignal for JavaScript issue tracker.

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.
This example uses an ES module configuration file, webpack.config.mjs.
Provide these variables in your build environment:
  • APPSIGNAL_PUSH_API_KEY holds your Push API key. Store it as a secret and keep it out of source control and the front-end bundle.
  • APPSIGNAL_APP_NAME matches the app name shown in AppSignal.
  • REVISION matches the revision option in your AppSignal for JavaScript configuration.
Set 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.

Options