From 017afcf90a3e1b8886d8af160743ad81d6300bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Fle=CC=81ron?= Date: Mon, 2 Dec 2019 15:10:49 +0100 Subject: [PATCH] Add option to upload minified files --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 90d2191..9e2ac18 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,8 @@ module.exports = { }, includeAppVersion: true, deleteSourcemaps: true, - overwrite: true + overwrite: true, + uploadMinifiedFile: false }, requiredConfig: ['apiKey', 'publicUrl'], @@ -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 }); @@ -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) {