Skip to content

Commit

Permalink
fix: upload bugsnag sourcemaps and report build
Browse files Browse the repository at this point in the history
  • Loading branch information
okdistribute committed Jun 23, 2020
1 parent 01be7c6 commit 3231424
Show file tree
Hide file tree
Showing 5 changed files with 402 additions and 96 deletions.
23 changes: 23 additions & 0 deletions bin/report-bugsnag-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const reportBuild = require('bugsnag-build-reporter')
const path = require('path')
const { upload } = require('bugsnag-sourcemaps')

const appVersion = require('../package.json').version

const Upload = upload

var opts = {
apiKey: process.env.BUGSNAG_API_KEY,
appVersion,
releaseStage: 'production'
}

reportBuild(opts)
.then(() => console.log('successfully reported build!'))
.catch(err => console.log('fail', err.messsage))

new Upload(Object.assign({}, opts, {
minifiedFile: path.resolve(__dirname, '..', 'static/build.js'),
sourceMap: path.resolve(__dirname, '..', 'static/build.js.map')
})).then(() => console.log('successfully uploaded sourcemaps!'))
.catch(err => console.log('fail', err.messsage))
Loading

0 comments on commit 3231424

Please sign in to comment.