Skip to content

Commit fc8ef31

Browse files
committed
build: remove axios node adapter from bundle
1 parent 876212d commit fc8ef31

File tree

4 files changed

+270
-8500
lines changed

4 files changed

+270
-8500
lines changed

.changeset/early-carrots-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@navigraph/auth": patch
3+
---
4+
5+
Removed the node-only `http` adapter from the bundled Axios code.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"prepack": "turbo run prepack --filter=./packages/*",
1515
"postpack": "turbo run postpack --filter=./packages/*",
1616
"test": "jest --verbose",
17-
"release": "changeset publish"
17+
"release": "changeset publish",
18+
"postinstall": "patch-package"
1819
},
1920
"devDependencies": {
2021
"@babel/core": "^7.18.5",
@@ -36,6 +37,7 @@
3637
"jest": "^29.5.0",
3738
"jest-environment-jsdom": "^29.2.2",
3839
"jest-localstorage-mock": "^2.4.26",
40+
"patch-package": "^8.0.0",
3941
"prettier": "^3.0.2",
4042
"rimraf": "^3.0.2",
4143
"ts-jest": "^29.1.0",

patches/axios+0.24.0.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/axios/lib/defaults.js b/node_modules/axios/lib/defaults.js
2+
index eaee189..be90e84 100644
3+
--- a/node_modules/axios/lib/defaults.js
4+
+++ b/node_modules/axios/lib/defaults.js
5+
@@ -19,9 +19,6 @@ function getDefaultAdapter() {
6+
if (typeof XMLHttpRequest !== 'undefined') {
7+
// For browsers use XHR adapter
8+
adapter = require('./adapters/xhr');
9+
- } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
10+
- // For node use HTTP adapter
11+
- adapter = require('./adapters/http');
12+
}
13+
return adapter;
14+
}

0 commit comments

Comments
 (0)