Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Commit

Permalink
Package not found errors (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro authored Jun 15, 2018
1 parent d57c7ec commit ed2fa32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/bsb-js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ed2fa32

Please sign in to comment.