Exit process with error on bundler errors (#2240) (#2244)

* Exit process with error on bundler errors (#2240)

Setting the errorCode within bundle.js does not change the exit code
when called with cli.js.  This moves the outer `try...catch` from
bundle.js to the `bundle` call in cli.js, so it can set the exit code.

* Lint

* Allow bundler to throw on error
This commit is contained in:
ᴙɘɘᴙgYmɘᴙɘj 2018-10-10 13:29:14 -04:00 committed by Isiah Meadows
parent d40d871a9d
commit 385458aadd

View file

@ -17,7 +17,6 @@ function parse(file) {
var error
function run(input, output) {
try {
var modules = {}
var bindings = {}
var declaration = /^\s*(?:var|let|const|function)[\t ]+([\w_$]+)/gm
@ -122,10 +121,6 @@ function run(input, output) {
fs.writeFileSync(output, code, "utf8")
}
}
catch (e) {
console.error(e.message)
}
}
module.exports = function(input, output, options) {
run(input, output)