Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.94 KB

File metadata and controls

66 lines (47 loc) · 1.94 KB

Sentry

Sentry Esbuild Plugin

npm version npm dm npm dt

An esbuild plugin that provides source map and release management support for Sentry.

Installation

Using npm:

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

Using yarn:

yarn add @sentry/esbuild-plugin --dev

Using pnpm:

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

Example

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

require("esbuild").build({
  sourcemap: true, // Source map generation must be turned on
  plugins: [
    // Put the Sentry esbuild plugin after all other plugins
    sentryEsbuildPlugin({
      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 esbuild 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