Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-sentry-plugin

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-sentry-plugin

Webpack plugin to upload source maps to Sentry

  • 1.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
decreased by-40.27%
Maintainers
1
Weekly downloads
 
Created
Source

Sentry plugin

Build Status

A webpack plugin to upload source maps to Sentry.

Installation

Using npm:

$ npm install webpack-sentry-plugin --save-dev

Using yarn:

$ yarn add webpack-sentry-plugin --dev

Usage

  1. Require webpack-sentry-plugin:

    var SentryPlugin = require('webpack-sentry-plugin');
    
  2. Configure webpack to output source maps. Recommended reading: webpack docs, Sentry docs

  3. Add to webpack config:

    var config = {
      plugins: [
        new SentryPlugin({
          // Sentry options are required
          organisation: 'your-organisation-name',
          project: 'your-project-name',
          apiKey: process.env.SENTRY_API_KEY,
          
          // Release version name/hash is required
          release: function() {
            return process.env.GIT_SHA
          }
        })
      ]
    }
    
Options
  • exclude: RegExp to match for excluded files

    var config = {
      plugins: [
        new SentryPlugin({
          // Exclude uploading of html
          exclude: /\.html$/,
          ...
        })
      ]
    }
    
  • include: RegExp to match for included files

    var config = {
      plugins: [
        new SentryPlugin({
          // Only upload foo.js & foo.js.map
          include: /foo.js/,
          ...
        })
      ]
    }
    
  • filenameTransform: Function to transform filename before uploading to Sentry. Defaults to prefixing filename with ~/, which is used by Sentry as a host wildcard

    var config = {
      plugins: [
        new SentryPlugin({
          filenameTransform: function(filename) {
            return 'a-filename-prefix-' + filename
          }
        })
      ]
    }
    
  • release: Release name to attach source maps to. Can be string or function that returns a string. If a function is passed, it will receive the build hash as an argument

var config = {
  plugins: [
    new SentryPlugin({
      release: function(hash) {
        return hash
      }
    })
  ]
}
  • suppressErrors: Display warnings instead of failing webpack build - useful in case webpack compilation is done during deploy on multiple instances

  • baseSentryURL: URL of Sentry instance. Shouldn't need to set if using sentry.io, but useful if self hosting

  • organisation: Sentry organisation to upload files to

  • project: Sentry project to upload files to

  • apiKey: Sentry api key (Generate one here)

Thanks

Contributing

Contributions are welcome 😄. To run the tests, please ensure you have the relevant environment variables set up. You can cp .env.example .env and fill it in with test account credentials. An API key can be created here, assuming you are signed in.

Commands to be aware of

Warning ⚠️: The test suite will create releases & upload files. They should be cleaned up afterward, but ensure that you are not overwriting something important!

  • npm test: Runs the test suite
  • npm run build: Compiles distribution build

Keywords

FAQs

Package last updated on 09 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc