browserify / browser-resolve

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

ability to specify alt browser mapping, for chromeapp or firefox app, etc. #55

Closed mvayngrib closed 9 years ago

mvayngrib commented 9 years ago

https://github.com/substack/node-browserify/issues/1094

when I browserify for a Chrome app, I want a slightly different mapping than I specify in the "browser" field. It would be cool if I could have an arbitrarily named field and tell browserify to use that instead of "browser", e.g.

browserify --browser=chromeapp main.js > bundle.js

and

"browser": {
  ...
},
"chromeapp": {
  ...
}

it would then default to "browser"

defunctzombie commented 9 years ago

What does @substack think about this? Are any other tools offering this functionality?

ghost commented 9 years ago

This could be a useful feature and straightforward to implement. It would also be useful on the browserify side to turn off the browser field entirely in some cases.

defunctzombie commented 9 years ago

@mvayngrib want to take a stab at a PR please?

mvayngrib commented 9 years ago

sure, I'll take a stab