Skip to content

Commit

Permalink
fix: patch axios to avoid calling process
Browse files Browse the repository at this point in the history
remove once parcel-bundler/parcel#8433 is fixed
  • Loading branch information
linden committed Sep 12, 2022
1 parent 534121c commit 0ede727
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -5,9 +5,12 @@
"packages/*"
],
"devDependencies": {
"lerna": "^5.4.3"
"lerna": "^5.4.3",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0"
},
"scripts": {
"postinstall": "patch-package",
"build": "lerna run --scope @firebase-proxy/* --scope firebase-proxy build",
"dev": "lerna run --parallel --scope @firebase-proxy/* --scope firebase-proxy dev"
}
Expand Down
21 changes: 21 additions & 0 deletions patches/axios+0.27.2.patch
@@ -0,0 +1,21 @@
diff --git a/node_modules/axios/lib/defaults/index.js b/node_modules/axios/lib/defaults/index.js
index 9199818..d954f5a 100644
--- a/node_modules/axios/lib/defaults/index.js
+++ b/node_modules/axios/lib/defaults/index.js
@@ -17,15 +17,7 @@ function setContentTypeIfUnset(headers, value) {
}

function getDefaultAdapter() {
- var adapter;
- if (typeof XMLHttpRequest !== 'undefined') {
- // For browsers use XHR adapter
- adapter = require('../adapters/xhr');
- } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
- // For node use HTTP adapter
- adapter = require('../adapters/http');
- }
- return adapter;
+ return require('../adapters/xhr');
}

function stringifySafely(rawValue, parser, encoder) {

0 comments on commit 0ede727

Please sign in to comment.