@honeybadger-io/webpack
v6.3.1
Published
Webpack plugin to upload source maps to Honeybadger's API - http://docs.honeybadger.io/guides/source-maps.html
Downloads
120,507
Readme
Honeybadger's Webpack Source Map Plugin
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 --devConfiguration
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 = environmentDevelopment
- Run
npm install - Run the tests with
npm test - Build/test on save with
npm run build:watchandnpm 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.
