Honeybadger's Webpack Source Map Plugin
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
Vanilla webpack.config.js
const HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack')
const ASSETS_URL = 'https://cdn.example.com/assets';
const webpackConfig = {
plugins: [new HoneybadgerSourceMapPlugin({
api_key: 'abc123',
assets_url: ASSETS_URL,
revision: 'master'
})]
}
Rails Webpacker config/webpack/environment.js
const { environment } = require('@rails/webpacker')
const HoneybadgerSourceMapPlugin = require('@honeybadger-io/webpack')
const revision = process.env.GIT_COMMIT || 'master'
environment.plugins.set(
'HoneybadgerSourceMap',
new HoneybadgerSourceMapPlugin({
api_key: process.env.HONEYBADGER_API_KEY,
assets_url: process.env.ASSETS_URL,
silent: false,
ignoreErrors: false,
revision: revision
}))
module.exports = environment
See example Rails 5 application
https://github.com/honeybadger-io/honeybadger-rails-webpacker-example
Contributing
- Fork it.
- Create a topic branch
git checkout -b my_branch
- Commit your changes
git commit -am "Boom"
- Push to your branch
git push origin my_branch
- Send a pull request
Development
Install the required npm packages with npm install
. Write code. Run tests npm test
. Repeat.
After that you can
The Honeybadger's Webpack Source Map Plugin is MIT licensed. See the
MIT-LICENSE
file in this repository for details.