node-source-map-support
node-source-map-support copied to clipboard
Enable running browser-bundled in Node.js
There is a function called isInBrowser() which is used to not run XMLHttpRequest's in Node. The documentation also mentions this, and the option to specify { environment: 'node' }.
However, the logic still uses XMLHttpRequest, hindering JavaScript bundled for the web to be run in Node.js, which is useful e.g. to perform server-side rendering of client-side routes - running the web app in Node.
This PR fixes this.