Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 1.91 KB

File metadata and controls

67 lines (47 loc) · 1.91 KB

Sentry

Sentry Webpack Plugin

npm version npm dm npm dt

A Webpack plugin that provides source map and release management support for Sentry.

Installation

Using npm:

npm install @sentry/webpack-plugin --save-dev

Using yarn:

yarn add @sentry/webpack-plugin --dev

Using pnpm:

pnpm add @sentry/webpack-plugin --save-dev

Example

// webpack.config.js
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");

module.exports = {
  // ... other config above ...

  devtool: "source-map", // Source map generation must be turned on
  plugins: [
    sentryWebpackPlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,

      // Auth tokens can be obtained from https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/
      authToken: process.env.SENTRY_AUTH_TOKEN,
    }),
  ],
};

#OPTIONS_SECTION_INSERT#

Configuration File

As an additional configuration method, the Sentry Webpack plugin will pick up environment variables configured inside a .env.sentry-build-plugin file located in the current working directory when building your app.

More information