* 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:
parent
d40d871a9d
commit
385458aadd
1 changed files with 99 additions and 104 deletions
|
|
@ -17,7 +17,6 @@ function parse(file) {
|
||||||
|
|
||||||
var error
|
var error
|
||||||
function run(input, output) {
|
function run(input, output) {
|
||||||
try {
|
|
||||||
var modules = {}
|
var modules = {}
|
||||||
var bindings = {}
|
var bindings = {}
|
||||||
var declaration = /^\s*(?:var|let|const|function)[\t ]+([\w_$]+)/gm
|
var declaration = /^\s*(?:var|let|const|function)[\t ]+([\w_$]+)/gm
|
||||||
|
|
@ -122,10 +121,6 @@ function run(input, output) {
|
||||||
fs.writeFileSync(output, code, "utf8")
|
fs.writeFileSync(output, code, "utf8")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
|
||||||
console.error(e.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = function(input, output, options) {
|
module.exports = function(input, output, options) {
|
||||||
run(input, output)
|
run(input, output)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue