Note: This repository has been moved to @honeybadger-io/js, home to all Honeybadger's JavaScript packages.
Webpack plugin to upload JavaScript sourcemaps to Honeybadger. You can also send deployment notifications.
Word Up! to the thredUP development team for a similar webpack plugin they have authored.
npm install @honeybadger-io/webpack --save-dev
These plugin parameters correspond to the Honeybadger Source Map Upload API and Deployments API.
apiKey
(required)assetsUrl
(required)*
wildcards are supported. The plugin combines assetsUrl
with the generated minified js file name to build the API parameter minified_url
endpoint
(optional — default: "https://api.honeybadger.io/v1/source_maps")revision
(optional — default: "master")silent
(optional — default: "null/false")ignoreErrors
(optional — default: false)retries
(optional — default: 3, max: 10)workerCount
(optional — default: 5, min: 1)deploy
(optional — default: false)true
, or to an object containing any of these fields (see the API reference):
environment
repository
localUsername
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',
// You can also enable deployment notifications:
deploy: {
environment: process.env.NODE_ENV,
repository: "https://github.com/yourusername/yourrepo"
}
})]
}
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
See https://github.com/honeybadger-io/honeybadger-webpack/blob/master/CHANGELOG.md
git checkout -b my_branch
git commit -am "Boom"
git push origin my_branch
npm install
npm test
npm run build:watch
and npm run test:watch
npm version [new version]
to bump the version,
commit the changes, tag the release, and push to GitHub. See npm help version
for documentation.npm publish
. See npm help publish
for
documentation.The Honeybadger's Webpack Source Map Plugin is MIT licensed. See the MIT-LICENSE file in this repository for details.