Skip to content

Conversation

@mushishi78
Copy link

@calvinmetcalf
Copy link
Collaborator

this is the thing that's supposed to be adding the global.process, I'm not sure you can check against it for this module.

@mushishi78
Copy link
Author

mushishi78 commented Dec 29, 2018

This is not adding the process object to the global process variable, it's adding it to the export for this package. The purpose is so that if you want to be agnostic about whether you're in browser, you can rely on the import of this library being there but you can't rely on the global variable being there.

The reason I needed this is because I'm trying out a bundler that doesn't respect the "browser" field in the package.json. I saw that the linked debug library had used this fix in later versions to support this use case so I figured it was fair to give PR to do the same here.

Could also probably just do this if you prefer:

module.exports = global.process || require('./browser.js');

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

Successfully merging this pull request may close these issues.

2 participants