@honeybadger-io/esbuild-plugin
v1.2.0
Published
Esbuild plugin to upload source maps to Honeybadger's API - http://docs.honeybadger.io/guides/source-maps.html
Downloads
858
Readme
Honeybadger's esbuild Source Map Plugin
esbuild plugin to upload JavaScript source maps and optionally send deployment notifications to Honeybadger.
Installation
# npm
npm install @honeybadger-io/esbuild-plugin --save-dev
# yarn
yarn add @honeybadger-io/esbuild-plugin --dev
Configuration
Plugin parameters
These plugin parameters correspond to the Honeybadger Source Map Upload API and Deployments API.
esbuild.config.js
Set sourcemap
to true
. Add the honeybadger plugin to the plugins array.
import { honeybadgerSourceMapPlugin } from '@honeybadger-io/esbuild-plugin'
// See plugin params above
const hbPluginOptions = {
apiKey: 'your_key_here',
assetsUrl: 'https://yoursite.foo',
revision: 'v1.0.0',
}
esbuild
.build({
entryPoints: ['src/index.ts'],
bundle: true,
minify: true,
format: 'cjs',
sourcemap: true,
outfile: 'dist/output.js',
plugins: [honeybadgerSourceMapPlugin(hbPluginOptions)]
})
.then(() => {
console.log('Build complete')
})
.catch((err) => {
console.error(err)
process.exit(1)
});
Development
- Run
npm install
- Run the tests with
npm test
- Build with
npm run build
See the /examples
folder for projects to test against.
License
This package is MIT licensed. See the MIT-LICENSE file in this folder for details.