Report builds to Bugsnag using Gulp
Use our Gulp module to:
Install the gulp-bugsnag
module.
npm install --save-dev gulp-bugsnag
gulp-bugsnag
can auto detect source control info from .git
, .hg
and package.json
.
For detailed usage instructions, check out the readme.
Here’s an example to get you started:
/* gulpfile.js */
const gulp = require('gulp')
const concat = require('gulp-concat')
const { reportBuild } = require('gulp-bugsnag')
gulp.task('build', () => {
gulp.src('src/*.js')
.pipe(concat('bundle.js'))
.pipe(gulp.dest('dist'))
.pipe(reportBuild({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3'
}))
})
// $ gulp build
// runs your build process and then notifies Bugsnag if the task succeeds
If you are using Bugsnag On-premise, you should set the endpoint
option to your Bugsnag Build API endpoint.
.pipe(reportBuild({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3'
}, {
endpoint: "https://build-bugsnag.internal.example.com"
}))
appVersion
There are a variety of ways to manage or inject version numbers in your build, so the following advice applies to whichever strategy you use.
appVersion
in your notifier so that sessions and error reports are correctly associated with your reported buildsappVersion
in sync with the build reporterappVersion
should change any time your source code, or any of its dependencies changesSupport for uploading source maps is coming soon. Until then please see our source map support guide.