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

@honeybadger-io/webpack

Package Overview
Dependencies
Maintainers
8
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@honeybadger-io/webpack

Webpack plugin to upload source maps to Honeybadger's API - http://docs.honeybadger.io/guides/source-maps.html

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
increased by17.94%
Maintainers
8
Weekly downloads
 
Created
Source

Honeybadger's Webpack Source Map Plugin

Node CI npm version npm dm npm dt

This is a webpack plugin to upload javascript sourcemaps to Honeybadger's API endpoint for source maps.

Word Up! to the thredUP development team for a similar webpack plugin they have authored.

Installation

Installing via Node.js

npm install @honeybadger-io/webpack --save-dev

Configuration

Plugin parameters

These plugin parameters correspond to the Honeybadger Sourcemap API.

apiKey (required)
The API key of your Honeybadger project
assetsUrl (required)
The base URL to production assets (scheme://host/path)*wildcards are supported. The plugin combines assetsUrl with the generated minified js file name to build the API parameter minified_url
revision (optional — default: "master")
The deploy revision (i.e. commit sha) that your source map applies to. This could also be a code version. For best results, set it to something unique every time your code changes.
silent (optional — default: "null/false")
If true, silence log information emitted by the plugin.
ignoreErrors (optional — default: "null/false")
If true, webpack compilation errors are treated as warnings.

Vanilla webpack.config.js

const HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack')
const ASSETS_URL = 'https://cdn.example.com/assets';
const webpackConfig = {
  plugins: [new HoneybadgerSourceMapPlugin({
    apiKey: 'abc123',
    assetsUrl: ASSETS_URL,
    revision: 'master'
  })]
}

Rails Webpacker config/webpack/environment.js

const { environment } = require('@rails/webpacker')
const HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack')

// Assumes Heroku / 12-factor application style ENV variables
// named GIT_COMMIT, HONEYBADGER_API_KEY, ASSETS_URL
const revision = process.env.GIT_COMMIT || 'master'

environment.plugins.append(
  'HoneybadgerSourceMap',
  new HoneybadgerSourceMapPlugin({
    apiKey: process.env.HONEYBADGER_API_KEY,
    assetsUrl: process.env.ASSETS_URL,
    silent: false,
    ignoreErrors: false,
    revision: revision
  }))

module.exports = environment

Development

  1. Run npm install
  2. Run the tests with npm test
  3. Build/test on save with npm run build:watch and npm run test:watch.

License

This package is MIT licensed. See the MIT-LICENSE file in this folder for details.

Keywords

FAQs

Package last updated on 13 Sep 2022

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