Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json parse browser field #178

Open
matthewp opened this issue Oct 18, 2016 · 0 comments
Open

package.json parse browser field #178

matthewp opened this issue Oct 18, 2016 · 0 comments

Comments

@matthewp
Copy link
Member

@whitecolor commented on Mon Jan 11 2016

works

"browser": "engine.io.js",

What do you think, should this work too?

"browser": {
  "main": "engine.io.js",
}

The problem with this module:
https://github.com/socketio/engine.io-client/blob/master/package.json#L57


@matthewp commented on Mon Jan 11 2016

We do support the browser field. What specifically is not working? By the way, we created steal-socket.io to make it easier to use with steal: https://github.com/stealjs/steal-socket.io


@whitecolor commented on Mon Jan 11 2016

Do you parse it? "main"? or just handle string value?

"browser": "engine.io.js",

But comlex object is in soket.io-client package.json - NO.


@whitecolor commented on Mon Jan 11 2016

Socket.io client is working with map:

"map": {
      "socket.io-client": "socket.io-client/socket.io"
    },

@matthewp commented on Mon Jan 11 2016

We do parse the browser object: https://github.com/stealjs/system-npm/blob/master/npm.js#L202

It's possible we are missing some scenarios though, would need more info to figure out what those are.


@whitecolor commented on Mon Jan 11 2016

if to add "main" to "browser" in https://github.com/socketio/engine.io-client/blob/master/package.json#L57
"browser": {
"main": "engine.io.js",
}

Steal doesn't see it.

BTW what does steal-socket.io do? Why it is needed?


@matthewp commented on Mon Jan 11 2016

What does "main" refer to here? Is this supposed to be the project main?


@whitecolor commented on Mon Jan 11 2016

I think yes it should be, a pretty standard convention, no?


@justinbmeyer commented on Mon Jan 11 2016

I don't think that's a supported property of browserify's "browser" option.

Sent from my iPhone

On Jan 11, 2016, at 9:44 AM, Alex [email protected] wrote:

if to add "main" to "browser" in https://github.com/socketio/engine.io-client/blob/master/package.json#L57
"browser": {
"main": "engine.io.js",
}

Steal doesn't see it.


Reply to this email directly or view it on GitHub.


@matthewp commented on Mon Jan 11 2016

I wasn't sure if it was or not. If not what you want to do instead is:

{
  "main": "main.js",
  "browser": {
    "./main.js": "./other.js"
  }
}

@whitecolor commented on Mon Jan 11 2016

Ok then there is no info about main
https://github.com/defunctzombie/package-browser-field-spec#replace-specific-files---advanced

but jspm.main field should be considered I believe stealjs/steal#550


@whitecolor commented on Wed Jan 13 2016

if "browser" field is an object I beleve in contains a paths map:
https://github.com/visionmedia/superagent/blob/master/package.json#L52

"./lib/node/index.js": "./lib/client.js"

So that if main was parsed as ./lib/node/index.jsfrom package.json then ./lib/client.js should be taken instead, without this support of "browser" field is not full.


@matthewp commented on Wed Jan 13 2016

Yes, we should be supporting this. There is definitely code for it. It's possible it's not working when the mapping is for the main.


@whitecolor commented on Wed Jan 13 2016

Yes if the is no main it seem to handle it.


@pYr0x commented on Tue Mar 22 2016

is this PR handle this issue? #67
should i resolve the conflicts on this PR?


@matthewp commented on Tue Mar 22 2016

@pYr0x if you're going to look into this would you mind adding a test to that pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant