fix usage of global object in browser environment#995
fix usage of global object in browser environment#995quanterion wants to merge 1 commit intoprotobufjs:masterfrom
Conversation
|
The expectation here is that the sources won't be used in something else than node, while the dist files can be used in various environments. Anyway, there are multiple options to solve such issues:
|
|
It would be great to implement 2nd option. Webpack is the most popular bundler in the wild, I think it should compatible with it. I can try to make a PR if you hint me how to do that. I can't understand how to add browser entry for full and minimal libraries. |
Good point. Maybe the package should expose the dist files for everything, and just use the sources for building. |
|
Yeah.. As I can see in many modern libraries like RxJS, angular, typescript etc. They all expose dist files only |
Browser code should not rely on things that are not available in browser environments. Otherwise it throws error global is undefined.
angular/angular-cli#9827 (comment)