From 772929837f19a12a7fb6bff5311ef895defe977f Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Wed, 26 Feb 2020 00:31:40 +0800 Subject: [PATCH] Throw error when bundle not found --- src/bundle.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bundle.js b/src/bundle.js index 26e69c2..a471bce 100644 --- a/src/bundle.js +++ b/src/bundle.js @@ -218,7 +218,9 @@ async function diffFromPPK(origin, next, output) { } }); - originSource = originSource || new Buffer(0); + if (!originSource) { + throw new Error(`Bundle file not found! Please use default bundle file name and path.`); + } const copies = {}; @@ -342,7 +344,9 @@ async function diffFromPackage(origin, next, output, originBundleName, transform } }); - originSource = originSource || new Buffer(0); + if (!originSource) { + throw new Error(`Bundle file not found! Please use default bundle file name and path.`); + } const copies = {};