From ed2fa3245da577d627a05fd684a6dc117319a1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Nuno=20Monteiro?= Date: Thu, 14 Jun 2018 20:14:24 -0700 Subject: [PATCH] Package not found errors (#45) --- packages/bsb-js/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/bsb-js/utils.js b/packages/bsb-js/utils.js index 07190fc..5135dc5 100644 --- a/packages/bsb-js/utils.js +++ b/packages/bsb-js/utils.js @@ -7,6 +7,7 @@ const fileNameRegex = /\.(ml|re)$/ const es6ReplaceRegex = /(from\ "\.\.?\/.*?)(\.bs\.js|\.js)("\;)/g const commonJsReplaceRegex = /(require\("\.\.?\/.*?)(\.bs\.js|\.js)("\);)/g const getErrorRegex = /(File [\s\S]*?:\r?\n|Fatal )[eE]rror: [\s\S]*?(?=ninja|\r?\n\r?\n|$)/g +const packageNotFoundRegex = /Package not found[\s\S]*?:?\r?\n[\s\S]*?[eE]rror:\s?[\s\S]*/g const getSuperErrorRegex = /We've found a bug for you![\s\S]*?(?=ninja: build stopped)/g const getWarningRegex = /((File [\s\S]*?Warning.+? \d+:)|Warning number \d+)[\s\S]*?(?=\[\d+\/\d+\]|$)/g @@ -38,6 +39,7 @@ function processBsbError(err /*: Error | string */) { return ( err.match(getSuperErrorRegex) || err.match(getErrorRegex) || + err.match(packageNotFoundRegex) || [] ).map(e => new Error(e)) } else if (err instanceof Error) {