shtylman/node-browser-resolve — pull request #24 by jaredhanson (2013-06-10 01:40:42+00:00)
Title: Add support for `opts.package`, and correctly handle browserify transform.

OK, this is an alternative PR to https://github.com/shtylman/node-browser-resolve/pull/23

It builds on top of your changes for "module": "alt-module" replacement, and adds support for `opts.package` and the `pkg` argument to the resolve callback that are now in `node-resolve`.

Additionally, it adds correct handling for packages that declare browserify transforms, in addition to browser replacements, as follows:

```
"browser": {
"foobar": "module-b",
"querystring": "module-c"
},
"browserify": {
"transform": "deamdify"
}
```

In this case, we don't want to unconditionally set `info.browser` to `info.browserify`, as that would overwrite the actual browser replacements.

This check now uses the same backwards compatibility check that browserify does here:
https://github.com/substack/node-browserify/blob/master/index.js#L332