Skip to content

Commit d462679

Browse files
committed
Better error reporting for browserify
When you get an error using browserify with the current config you get something akin to the following: ParseError: Unexpected token . this fix changes this to something more along the lines of /Users/reubendoetsch/recombine/orginal-labs/src/scripts/ng-app/services/recombine_api_service.js:15 Restangular..setDefaultHttpFields({withCredentials: true}); which is massively helpful for debugging these sort of errors. I checked other browserify errors and they all work as intended.
1 parent 4dfd41a commit d462679

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ module.exports = {
126126
} else if (err.lineNumber) {
127127
message += ' at line ' + chalk.bold(err.lineNumber);
128128
}
129-
130-
console.log(message);
131-
console.log(chalk.red(err.message));
129+
if(plugin == "browserify") {
130+
console.log(err);
131+
} else {
132+
console.log(message);
133+
console.log(chalk.red(err.message));
134+
}
132135
}
133136
},
134137
rename: {

0 commit comments

Comments
 (0)