browserify / browser-resolve

resolve function which support the browser field in package.json
MIT License
102 stars 70 forks source link

Include file path in error message #21

Closed timoxley closed 11 years ago

timoxley commented 11 years ago

Currently, if there's a syntax error in the package.json, browserify quits with a fairly cryptic message:

> browserify index.js
SyntaxError: Unexpected token }

After some time I figured out this wasn't a syntax error in my source code, rather it was in the package.json and the error was coming out of node-browser-resolve. Would be nice if node-browser-resolve exposed the file name causing the parse error if it comes across one.

Errors now look like:

/…/…/project/package.json : Unexpected token }