axios 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +139 -74
- package/{UPGRADE_GUIDE.md → MIGRATION_GUIDE.md} +1 -1
- package/README.md +59 -22
- package/dist/axios.js +754 -576
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +3054 -0
- package/dist/browser/axios.cjs.map +1 -0
- package/dist/esm/axios.js +719 -595
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +618 -517
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +490 -0
- package/index.d.ts +33 -11
- package/index.js +8 -3
- package/karma.conf.cjs +1 -1
- package/lib/adapters/adapters.js +59 -0
- package/lib/adapters/http.js +23 -21
- package/lib/adapters/xhr.js +5 -2
- package/lib/axios.js +7 -3
- package/lib/core/Axios.js +10 -8
- package/lib/core/AxiosError.js +1 -1
- package/lib/core/AxiosHeaders.js +82 -76
- package/lib/core/dispatchRequest.js +6 -1
- package/lib/core/mergeConfig.js +50 -46
- package/lib/defaults/index.js +2 -21
- package/lib/env/data.js +1 -1
- package/lib/utils.js +68 -8
- package/package.json +14 -7
- package/rollup.config.js +37 -10
- package/tsconfig.json +2 -7
- package/tslint.json +6 -1
- package/lib/adapters/index.js +0 -33
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,144 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.2.0] - 2022-11-10
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162)
|
8
|
+
- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225)
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224)
|
13
|
+
- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196)
|
14
|
+
- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071)
|
15
|
+
- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269)
|
16
|
+
- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247)
|
17
|
+
- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250)
|
18
|
+
|
19
|
+
### Refactors
|
20
|
+
- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277)
|
21
|
+
|
22
|
+
### Chores
|
23
|
+
|
24
|
+
- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243)
|
25
|
+
- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077)
|
26
|
+
- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116)
|
27
|
+
- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205)
|
28
|
+
- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235)
|
29
|
+
- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266)
|
30
|
+
- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295)
|
31
|
+
- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294)
|
32
|
+
- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241)
|
33
|
+
- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245)
|
34
|
+
- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119)
|
35
|
+
- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265)
|
36
|
+
- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218)
|
37
|
+
- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170)
|
38
|
+
- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194)
|
39
|
+
- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193)
|
40
|
+
- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184)
|
41
|
+
- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197)
|
42
|
+
- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261)
|
43
|
+
- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207)
|
44
|
+
- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137)
|
45
|
+
- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025)
|
46
|
+
|
47
|
+
### Contributors to this release
|
48
|
+
|
49
|
+
- [Maddy Miller](https://github.com/me4502)
|
50
|
+
- [Amit Saini](https://github.com/amitsainii)
|
51
|
+
- [ecyrbe](https://github.com/ecyrbe)
|
52
|
+
- [Ikko Ashimine](https://github.com/eltociear)
|
53
|
+
- [Geeth Gunnampalli](https://github.com/thetechie7)
|
54
|
+
- [Shreem Asati](https://github.com/shreem-123)
|
55
|
+
- [Frieder Bluemle](https://github.com/friederbluemle)
|
56
|
+
- [윤세영](https://github.com/yunseyeong)
|
57
|
+
- [Claudio Busatto](https://github.com/cjcbusatto)
|
58
|
+
- [Remco Haszing](https://github.com/remcohaszing)
|
59
|
+
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
60
|
+
- [Csaba Maulis](https://github.com/om4csaba)
|
61
|
+
- [MoPaMo](https://github.com/MoPaMo)
|
62
|
+
- [Daniel Fjeldstad](https://github.com/w3bdesign)
|
63
|
+
- [Adrien Brunet](https://github.com/adrien-may)
|
64
|
+
- [Frazer Smith](https://github.com/Fdawgs)
|
65
|
+
- [HaiTao](https://github.com/836334258)
|
66
|
+
- [AZM](https://github.com/aziyatali)
|
67
|
+
- [relbns](https://github.com/relbns)
|
68
|
+
|
69
|
+
## [1.1.3] - 2022-10-15
|
70
|
+
|
71
|
+
### Added
|
72
|
+
|
73
|
+
- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
|
74
|
+
|
75
|
+
### Fixed
|
76
|
+
|
77
|
+
- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
|
78
|
+
- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
|
79
|
+
- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
|
80
|
+
- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
|
81
|
+
- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
|
82
|
+
- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
|
83
|
+
|
84
|
+
### Chores
|
85
|
+
|
86
|
+
- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
|
87
|
+
- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
|
88
|
+
- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
|
89
|
+
- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
|
90
|
+
|
91
|
+
### Contributors to this release
|
92
|
+
|
93
|
+
- [Jason Saayman](https://github.com/jasonsaayman)
|
94
|
+
- [scarf](https://github.com/scarf005)
|
95
|
+
- [Lenz Weber-Tronic](https://github.com/phryneas)
|
96
|
+
- [Arvindh](https://github.com/itsarvindh)
|
97
|
+
- [Félix Legrelle](https://github.com/FelixLgr)
|
98
|
+
- [Patrick Petrovic](https://github.com/ppati000)
|
99
|
+
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
100
|
+
- [littledian](https://github.com/littledian)
|
101
|
+
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
|
102
|
+
|
103
|
+
## [1.1.2] - 2022-10-07
|
104
|
+
|
105
|
+
### Fixed
|
106
|
+
|
107
|
+
- Fixed broken exports for UMD builds.
|
108
|
+
|
109
|
+
### Contributors to this release
|
110
|
+
|
111
|
+
- [Jason Saayman](https://github.com/jasonsaayman)
|
112
|
+
|
113
|
+
## [1.1.1] - 2022-10-07
|
114
|
+
|
115
|
+
### Fixed
|
116
|
+
|
117
|
+
- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful.
|
118
|
+
|
119
|
+
### Contributors to this release
|
120
|
+
|
121
|
+
- [Jason Saayman](https://github.com/jasonsaayman)
|
122
|
+
|
123
|
+
## [1.1.0] - 2022-10-06
|
124
|
+
|
125
|
+
### Fixed
|
126
|
+
|
127
|
+
- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003)
|
128
|
+
- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018)
|
129
|
+
- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021)
|
130
|
+
- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010)
|
131
|
+
- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030)
|
132
|
+
- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036)
|
133
|
+
|
134
|
+
### Contributors to this release
|
135
|
+
|
136
|
+
- [Trim21](https://github.com/trim21)
|
137
|
+
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
138
|
+
- [shingo.sasaki](https://github.com/s-sasaki-0529)
|
139
|
+
- [Ivan Pepelko](https://github.com/ivanpepelko)
|
140
|
+
- [Richard Kořínek](https://github.com/risa)
|
141
|
+
|
3
142
|
## [1.0.0] - 2022-10-04
|
4
143
|
|
5
144
|
### Added
|
@@ -179,77 +318,3 @@
|
|
179
318
|
- [Luca Pizzini](https://github.com/lpizzinidev)
|
180
319
|
- [Willian Agostini](https://github.com/WillianAgostini)
|
181
320
|
- [Huyen Nguyen](https://github.com/huyenltnguyen)
|
182
|
-
|
183
|
-
## [1.1.0] - 2022-10-06
|
184
|
-
|
185
|
-
### Fixed
|
186
|
-
|
187
|
-
- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003)
|
188
|
-
- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018)
|
189
|
-
- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021)
|
190
|
-
- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010)
|
191
|
-
- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030)
|
192
|
-
- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036)
|
193
|
-
|
194
|
-
### Contributors to this release
|
195
|
-
|
196
|
-
- [Trim21](https://github.com/trim21)
|
197
|
-
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
198
|
-
- [shingo.sasaki](https://github.com/s-sasaki-0529)
|
199
|
-
- [Ivan Pepelko](https://github.com/ivanpepelko)
|
200
|
-
- [Richard Kořínek](https://github.com/risa)
|
201
|
-
|
202
|
-
## [1.1.1] - 2022-10-07
|
203
|
-
|
204
|
-
### Fixed
|
205
|
-
|
206
|
-
- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful.
|
207
|
-
|
208
|
-
### Contributors to this release
|
209
|
-
|
210
|
-
- [Jason Saayman](https://github.com/jasonsaayman)
|
211
|
-
|
212
|
-
## [1.1.2] - 2022-10-07
|
213
|
-
|
214
|
-
### Fixed
|
215
|
-
|
216
|
-
- Fixed broken exports for UMD builds.
|
217
|
-
|
218
|
-
### Contributors to this release
|
219
|
-
|
220
|
-
- [Jason Saayman](https://github.com/jasonsaayman)
|
221
|
-
|
222
|
-
## [1.1.3] - 2022-10-15
|
223
|
-
|
224
|
-
### Added
|
225
|
-
Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
|
226
|
-
|
227
|
-
### Fixed
|
228
|
-
|
229
|
-
Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
|
230
|
-
Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
|
231
|
-
Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
|
232
|
-
Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
|
233
|
-
Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
|
234
|
-
Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
|
235
|
-
|
236
|
-
### Chores
|
237
|
-
|
238
|
-
docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
|
239
|
-
chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
|
240
|
-
chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
|
241
|
-
chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
|
242
|
-
|
243
|
-
### Contributors to this release
|
244
|
-
|
245
|
-
- [Jason Saayman](https://github.com/jasonsaayman)
|
246
|
-
- [scarf](https://github.com/scarf005)
|
247
|
-
- [Lenz Weber-Tronic](https://github.com/phryneas)
|
248
|
-
- [Arvindh](https://github.com/itsarvindh)
|
249
|
-
- [Félix Legrelle](https://github.com/FelixLgr)
|
250
|
-
- [Patrick Petrovic](https://github.com/ppati000)
|
251
|
-
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
|
252
|
-
- [littledian](https://github.com/littledian)
|
253
|
-
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
|
254
|
-
- [Salman Shaikh](https://github.com/salmannotkhan)
|
255
|
-
|
package/README.md
CHANGED
@@ -35,6 +35,8 @@
|
|
35
35
|
- [Features](#features)
|
36
36
|
- [Browser Support](#browser-support)
|
37
37
|
- [Installing](#installing)
|
38
|
+
- [Package manager](#package-manager)
|
39
|
+
- [CDN](#cdn)
|
38
40
|
- [Example](#example)
|
39
41
|
- [Axios API](#axios-api)
|
40
42
|
- [Request method aliases](#request-method-aliases)
|
@@ -79,7 +81,7 @@
|
|
79
81
|
- Intercept request and response
|
80
82
|
- Transform request and response data
|
81
83
|
- Cancel requests
|
82
|
-
- Automatic transforms for JSON data
|
84
|
+
- Automatic transforms for [JSON](https://www.json.org/json-en.html) data
|
83
85
|
- 🆕 Automatic data object serialization to `multipart/form-data` and `x-www-form-urlencoded` body encodings
|
84
86
|
- Client side support for protecting against [XSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
|
85
87
|
|
@@ -93,6 +95,8 @@ Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
|
|
93
95
|
|
94
96
|
## Installing
|
95
97
|
|
98
|
+
### Package manager
|
99
|
+
|
96
100
|
Using npm:
|
97
101
|
|
98
102
|
```bash
|
@@ -117,7 +121,39 @@ Using pnpm:
|
|
117
121
|
$ pnpm add axios
|
118
122
|
```
|
119
123
|
|
120
|
-
|
124
|
+
Once the package is installed, you can import the library using `import` or `require` approach:
|
125
|
+
|
126
|
+
```js
|
127
|
+
import axios, {isCancel, AxiosError} from 'axios';
|
128
|
+
```
|
129
|
+
|
130
|
+
You can also use the default export, since the named export is just a re-export from the Axios factory:
|
131
|
+
|
132
|
+
```js
|
133
|
+
import axios from 'axios';
|
134
|
+
|
135
|
+
console.log(axios.isCancel('something'));
|
136
|
+
````
|
137
|
+
|
138
|
+
If you use `require` for importing, **only default export is available**:
|
139
|
+
|
140
|
+
```js
|
141
|
+
const axios = require('axios');
|
142
|
+
|
143
|
+
console.log(axios.isCancel('something'));
|
144
|
+
```
|
145
|
+
|
146
|
+
For cases where something went wrong when trying to import a module into a custom or legacy environment,
|
147
|
+
you can try importing the module package directly:
|
148
|
+
|
149
|
+
```js
|
150
|
+
const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundle (ES2017)
|
151
|
+
// const axios = require('axios/dist/node/axios.cjs'); // node commonJS bundle (ES2017)
|
152
|
+
```
|
153
|
+
|
154
|
+
### CDN
|
155
|
+
|
156
|
+
Using jsDelivr CDN (ES5 UMD browser module):
|
121
157
|
|
122
158
|
```html
|
123
159
|
<script src="https://cdn.jsdelivr.net/npm/axios@1.1.2/dist/axios.min.js"></script>
|
@@ -131,19 +167,12 @@ Using unpkg CDN:
|
|
131
167
|
|
132
168
|
## Example
|
133
169
|
|
134
|
-
|
135
|
-
In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()
|
170
|
+
> **Note** CommonJS usage
|
171
|
+
> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach:
|
136
172
|
|
137
173
|
```js
|
138
|
-
|
139
|
-
|
140
|
-
// axios.<method> will now provide autocomplete and parameter typings
|
141
|
-
```
|
142
|
-
|
143
|
-
Performing a `GET` request
|
144
|
-
|
145
|
-
```js
|
146
|
-
const axios = require('axios').default;
|
174
|
+
import axios from 'axios';
|
175
|
+
//const axios = require('axios'); // legacy way
|
147
176
|
|
148
177
|
// Make a request for a user with a given ID
|
149
178
|
axios.get('/user?ID=12345')
|
@@ -734,6 +763,8 @@ Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all t
|
|
734
763
|
|
735
764
|
## Handling Errors
|
736
765
|
|
766
|
+
the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error.
|
767
|
+
|
737
768
|
```js
|
738
769
|
axios.get('/user/12345')
|
739
770
|
.catch(function (error) {
|
@@ -756,7 +787,7 @@ axios.get('/user/12345')
|
|
756
787
|
});
|
757
788
|
```
|
758
789
|
|
759
|
-
Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error.
|
790
|
+
Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error.
|
760
791
|
|
761
792
|
```js
|
762
793
|
axios.get('/user/12345', {
|
@@ -797,7 +828,7 @@ controller.abort()
|
|
797
828
|
|
798
829
|
You can also cancel a request using a *CancelToken*.
|
799
830
|
|
800
|
-
> The axios cancel token API is based on the withdrawn [
|
831
|
+
> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises).
|
801
832
|
|
802
833
|
> This API is deprecated since v0.22.0 and shouldn't be used in new projects
|
803
834
|
|
@@ -853,7 +884,7 @@ cancel();
|
|
853
884
|
|
854
885
|
### URLSearchParams
|
855
886
|
|
856
|
-
By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers, [
|
887
|
+
By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers,and [ Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) starting with v10 (released in 2018).
|
857
888
|
|
858
889
|
```js
|
859
890
|
const params = new URLSearchParams({ foo: 'bar' });
|
@@ -917,7 +948,7 @@ await axios.postForm('https://postman-echo.com/post', data,
|
|
917
948
|
);
|
918
949
|
```
|
919
950
|
|
920
|
-
The server will handle it as
|
951
|
+
The server will handle it as:
|
921
952
|
|
922
953
|
```js
|
923
954
|
{
|
@@ -1250,6 +1281,12 @@ try {
|
|
1250
1281
|
}
|
1251
1282
|
```
|
1252
1283
|
|
1284
|
+
Because axios dual publishes with an ESM default export and a CJS `module.exports`, there are some caveats.
|
1285
|
+
The recommended setting is to use `"moduleResolution": "node16"` (this is implied by `"module": "node16"`). Note that this requires TypeScript 4.7 or greater.
|
1286
|
+
If use ESM, your settings should be fine.
|
1287
|
+
If you compile TypeScript to CJS and you can’t use `"moduleResolution": "node 16"`, you have to enable `esModuleInterop`.
|
1288
|
+
If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`.
|
1289
|
+
|
1253
1290
|
## Online one-click setup
|
1254
1291
|
|
1255
1292
|
You can use Gitpod, an online IDE(which is free for Open Source) for contributing or running the examples online.
|
@@ -1259,11 +1296,11 @@ You can use Gitpod, an online IDE(which is free for Open Source) for contributin
|
|
1259
1296
|
|
1260
1297
|
## Resources
|
1261
1298
|
|
1262
|
-
* [Changelog](https://github.com/axios/axios/blob/
|
1263
|
-
* [Upgrade Guide](https://github.com/axios/axios/blob/
|
1264
|
-
* [Ecosystem](https://github.com/axios/axios/blob/
|
1265
|
-
* [Contributing Guide](https://github.com/axios/axios/blob/
|
1266
|
-
* [Code of Conduct](https://github.com/axios/axios/blob/
|
1299
|
+
* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
|
1300
|
+
* [Upgrade Guide](https://github.com/axios/axios/blob/v1.x/UPGRADE_GUIDE.md)
|
1301
|
+
* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md)
|
1302
|
+
* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md)
|
1303
|
+
* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md)
|
1267
1304
|
|
1268
1305
|
## Credits
|
1269
1306
|
|