6.3.0 • Published 9 months ago

@honeybadger-io/webpack v6.3.0

Weekly downloads
8,536
License
MIT
Repository
github
Last release
9 months ago

Honeybadger's Webpack Source Map Plugin

Node CI npm version npm dm npm dt

Webpack plugin to upload JavaScript source maps to Honeybadger. You can also send deployment notifications.

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

Installation

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

# yarn
yarn add @honeybadger-io/webpack --dev

Configuration

Plugin parameters

These plugin parameters correspond to the Honeybadger Source Map Upload API and Deployments API.

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: 'main',
    // You can also enable deployment notifications:
    deploy: {
       environment: process.env.NODE_ENV,
       repository: "https://github.com/yourusername/yourrepo"
    }
  })]
}

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 || 'main'

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

See the /example folder for a project to test against.

License

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

6.3.0

9 months ago

6.2.2

9 months ago

6.2.1

1 year ago

6.2.0

1 year ago

6.1.0

2 years ago

6.0.0

2 years ago

6.1.1

2 years ago

5.1.7

2 years ago

5.1.0

2 years ago

5.0.0

2 years ago

4.10.0

2 years ago

4.7.5

3 years ago

4.7.1

3 years ago

4.8.2

3 years ago

4.7.3

3 years ago

4.3.1

3 years ago

4.3.0

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.3.0-beta.0

4 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago