axios 1.1.3 → 1.2.0-alpha.1
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.
- package/CHANGELOG.md +123 -74
- package/{UPGRADE_GUIDE.md → MIGRATION_GUIDE.md} +1 -1
- package/README.md +55 -20
- package/dist/axios.js +356 -211
- 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 +3010 -0
- package/dist/browser/axios.cjs.map +1 -0
- package/dist/esm/axios.js +296 -216
- 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 +224 -166
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +490 -0
- package/index.d.ts +28 -10
- package/index.js +8 -3
- package/karma.conf.cjs +1 -1
- package/lib/adapters/http.js +2 -2
- package/lib/adapters/xhr.js +2 -1
- package/lib/axios.js +7 -3
- package/lib/core/Axios.js +10 -8
- package/lib/core/AxiosHeaders.js +82 -76
- package/lib/core/dispatchRequest.js +4 -0
- package/lib/core/mergeConfig.js +50 -46
- package/lib/defaults/index.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/utils.js +36 -8
- package/package.json +13 -6
- package/rollup.config.js +37 -10
- package/tsconfig.json +2 -7
- package/tslint.json +6 -1
package/rollup.config.js
CHANGED
|
@@ -5,20 +5,28 @@ import json from '@rollup/plugin-json';
|
|
|
5
5
|
import { babel } from '@rollup/plugin-babel';
|
|
6
6
|
import autoExternal from 'rollup-plugin-auto-external';
|
|
7
7
|
import bundleSize from 'rollup-plugin-bundle-size'
|
|
8
|
+
import path from 'path';
|
|
8
9
|
|
|
9
10
|
const lib = require("./package.json");
|
|
10
11
|
const outputFileName = 'axios';
|
|
11
12
|
const name = "axios";
|
|
12
|
-
const
|
|
13
|
+
const namedInput = './index.js';
|
|
14
|
+
const defaultInput = './lib/axios.js';
|
|
13
15
|
|
|
14
16
|
const buildConfig = ({es5, browser = true, minifiedVersion = true, ...config}) => {
|
|
17
|
+
const {file} = config.output;
|
|
18
|
+
const ext = path.extname(file);
|
|
19
|
+
const basename = path.basename(file, ext);
|
|
20
|
+
const extArr = ext.split('.');
|
|
21
|
+
extArr.shift();
|
|
22
|
+
|
|
15
23
|
|
|
16
24
|
const build = ({minified}) => ({
|
|
17
|
-
input,
|
|
25
|
+
input: namedInput,
|
|
18
26
|
...config,
|
|
19
27
|
output: {
|
|
20
28
|
...config.output,
|
|
21
|
-
file: `${
|
|
29
|
+
file: `${path.dirname(file)}/${basename}.${(minified ? ['min', ...extArr] : extArr).join('.')}`
|
|
22
30
|
},
|
|
23
31
|
plugins: [
|
|
24
32
|
json(),
|
|
@@ -50,10 +58,24 @@ export default async () => {
|
|
|
50
58
|
const banner = `// Axios v${lib.version} Copyright (c) ${year} ${lib.author} and contributors`;
|
|
51
59
|
|
|
52
60
|
return [
|
|
61
|
+
// browser ESM bundle for CDN
|
|
53
62
|
...buildConfig({
|
|
63
|
+
input: namedInput,
|
|
64
|
+
output: {
|
|
65
|
+
file: `dist/esm/${outputFileName}.js`,
|
|
66
|
+
format: "esm",
|
|
67
|
+
preferConst: true,
|
|
68
|
+
exports: "named",
|
|
69
|
+
banner
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
|
|
73
|
+
// Browser UMD bundle for CDN
|
|
74
|
+
...buildConfig({
|
|
75
|
+
input: defaultInput,
|
|
54
76
|
es5: true,
|
|
55
77
|
output: {
|
|
56
|
-
file: `dist/${outputFileName}`,
|
|
78
|
+
file: `dist/${outputFileName}.js`,
|
|
57
79
|
name,
|
|
58
80
|
format: "umd",
|
|
59
81
|
exports: "default",
|
|
@@ -61,18 +83,23 @@ export default async () => {
|
|
|
61
83
|
}
|
|
62
84
|
}),
|
|
63
85
|
|
|
86
|
+
// Browser CJS bundle
|
|
64
87
|
...buildConfig({
|
|
88
|
+
input: defaultInput,
|
|
89
|
+
es5: false,
|
|
90
|
+
minifiedVersion: false,
|
|
65
91
|
output: {
|
|
66
|
-
file: `dist/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
exports: "
|
|
92
|
+
file: `dist/browser/${name}.cjs`,
|
|
93
|
+
name,
|
|
94
|
+
format: "cjs",
|
|
95
|
+
exports: "default",
|
|
70
96
|
banner
|
|
71
97
|
}
|
|
72
98
|
}),
|
|
73
|
-
|
|
99
|
+
|
|
100
|
+
// Node.js commonjs bundle
|
|
74
101
|
{
|
|
75
|
-
input,
|
|
102
|
+
input: defaultInput,
|
|
76
103
|
output: {
|
|
77
104
|
file: `dist/node/${name}.cjs`,
|
|
78
105
|
format: "cjs",
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
3
|
+
"module": "node16",
|
|
4
4
|
"lib": ["dom", "es2015"],
|
|
5
5
|
"types": [],
|
|
6
|
-
"moduleResolution": "node",
|
|
7
6
|
"strict": true,
|
|
8
|
-
"noEmit": true
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"paths": {
|
|
11
|
-
"axios": ["."]
|
|
12
|
-
}
|
|
7
|
+
"noEmit": true
|
|
13
8
|
}
|
|
14
9
|
}
|