Rollup

You can use the Sentry Rollup plugin to automatically create releases and upload source maps to Sentry when bundling your app.

Installation

Copied
npm install @sentry/rollup-plugin --save-dev

Configuration

Learn more about configuring the plugin in our Sentry Rollup Plugin documentation.

Example:

rollup.config.js
Copied
import { sentryRollupPlugin } from "@sentry/rollup-plugin";

export default {
  input: "./src/index.js",
  plugins: [
    // Put the Sentry rollup plugin after all other plugins
    sentryRollupPlugin({
      org: "example-org",
      project: "example-project",

      // Auth tokens can be obtained from https://sentry.io/settings/account/api/auth-tokens/
      // and need `project:releases` and `org:read` scopes
      authToken: process.env.SENTRY_AUTH_TOKEN,

      sourcemaps: {
        // Specify the directory containing build artifacts
        assets: "./out/**",
      },

      // Use the following option if you're on an SDK version lower than 7.47.0:
      // include: "./out",

      // Optionally uncomment the line below to override automatic release name detection
      // release: process.env.RELEASE,
    }),
  ],
  output: {
    sourcemap: true, // Source map generation must be turned on
    dir: "./out",
  },
};
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").