-
Couldn't load subscription status.
- Fork 159
Description
browserify defines a browser field in package.json as the recommended method for library authors to account for the differences between a browser and node environment in universal JS packages. This allows, for example, using the same websocket API in client-side and browser-side code: https://github.com/gabrielgrant/javascript-universal-websocket-client
Unfortunately, fastboot doesn't take this field into account, and tries to use the browser implementation despite running in Node. Is the expectation that every library in the npm ecosystem currently using the browser field also add fastboot guards? This seems unlikely to happen, especially given that (afaiu) require()s can't be wrapped in conditionals, making the changes required not-entirely-trivial to do (and also requiring that all node polyfill code be included in browser-compiled bundles)
Is there any way to get fastboot to respect browserify's browser field?