Skip to content

Commit

Permalink
Add option to upload minified files
Browse files Browse the repository at this point in the history
  • Loading branch information
tempo22 committed Dec 2, 2019
1 parent 1153069 commit 017afcf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ module.exports = {
},
includeAppVersion: true,
deleteSourcemaps: true,
overwrite: true
overwrite: true,
uploadMinifiedFile: false
},

requiredConfig: ['apiKey', 'publicUrl'],
Expand All @@ -50,6 +51,7 @@ module.exports = {
let publicUrl = this.readConfig('publicUrl');
let overwrite = this.readConfig('overwrite');
let includeAppVersion = this.readConfig('includeAppVersion');
let uploadMinifiedFile = this.readConfig('uploadMinifiedFile');

log('Uploading sourcemaps to bugsnag', { verbose: true });

Expand All @@ -64,6 +66,12 @@ module.exports = {
sourceMap: this._readSourceMap(path.join(distDir, mapFilePath))
};

if (uploadMinifiedFile) {
formData.minifiedFile = this._readSourceMap(
path.join(distDir, jsFilePath)
);
}

// the presence of any value for this flag causes the API to interpret it as
// true, so only add it to the payload if it is truthy
if (overwrite) {
Expand Down

0 comments on commit 017afcf

Please sign in to comment.