From b857d27740fb02472e3903982878b3663e79b07d Mon Sep 17 00:00:00 2001 From: Songkeys Date: Mon, 1 Feb 2021 12:02:34 +0800 Subject: [PATCH 1/3] chore: add console output when minifying fails --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5ea3f6bb..fadd951f 100644 --- a/src/index.js +++ b/src/index.js @@ -410,11 +410,14 @@ function ncc ( }); // For some reason, auth0 returns "undefined"! // custom terser phase used over Webpack integration for this reason - if (result.code !== undefined) + if (result.code !== undefined) { ({ code, map } = { code: result.code, map: sourceMap ? JSON.parse(result.map) : undefined }); + } else { + console.log('Error happens when minifying. The result will not be minified.') + } } if (v8cache) { From 6d97f8947018d4bdffb71ff04835c19e4a8a7a4c Mon Sep 17 00:00:00 2001 From: Songkeys Date: Mon, 1 Feb 2021 12:06:26 +0800 Subject: [PATCH 2/3] chore(style): tabs to spaces --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fadd951f..a14e6267 100644 --- a/src/index.js +++ b/src/index.js @@ -416,7 +416,7 @@ function ncc ( map: sourceMap ? JSON.parse(result.map) : undefined }); } else { - console.log('Error happens when minifying. The result will not be minified.') + console.log('Error happens when minifying. The result will not be minified.') } } From 382a7e5f726804fdd0a012b9ba02467bc74caca7 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 11 Mar 2021 17:32:38 -0500 Subject: [PATCH 3/3] Update error message --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a14e6267..b70076b9 100644 --- a/src/index.js +++ b/src/index.js @@ -416,7 +416,7 @@ function ncc ( map: sourceMap ? JSON.parse(result.map) : undefined }); } else { - console.log('Error happens when minifying. The result will not be minified.') + console.log('An error occurred while minifying. The result will not be minified.') } }