Skip to content

Commit

Permalink
fix: eep top-level export same with static properties (#5109)
Browse files Browse the repository at this point in the history
* chore: add necessary devDependencies for rollup build

* fix: keep top-level export same with static properties(#5031)

Co-authored-by: ronggui.shu <ronggui.shu@sci-inv.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
3 people committed Oct 13, 2022
1 parent 9d4b016 commit ef1c48a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions index.js
@@ -1,2 +1,32 @@
import axios from './lib/axios.js';

// Keep top-level export same with static properties
// so that it can keep same with es module or cjs
const {
Axios,
AxiosError,
CanceledError,
isCancel,
CancelToken,
VERSION,
all,
Cancel,
isAxiosError,
spread,
toFormData
} = axios;

export default axios;
export {
Axios,
AxiosError,
CanceledError,
isCancel,
CancelToken,
VERSION,
all,
Cancel,
isAxiosError,
spread,
toFormData
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -52,6 +52,7 @@
},
"homepage": "https://axios-http.com",
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^15.1.0",
Expand Down Expand Up @@ -130,4 +131,4 @@
"Ben Carp (https://github.com/carpben)",
"Daniel Lopretto (https://github.com/timemachine3030)"
]
}
}

0 comments on commit ef1c48a

Please sign in to comment.