mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
fix: fix export for React Native and Browserify (#7386)
Browserify and React Native projects (that aren't using `unstable_enablePackageExports`) use the `main` field as the package entrypoint. A recent PR (#5756) updated `main` to use a CommonJS bundle for Node.js, which caused Browserify and React Native projects to use the Node.js bundle. This led to many reports of broken React Native builds. This has been fixed by adding an entry to `browser` and `react-native` to re-map the Node.js CommonJS bundle to the browser CommonJS bundle.
This commit is contained in:
parent
29f75425f0
commit
335b79ffb6
@ -149,11 +149,13 @@
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"browser": {
|
||||
"./dist/node/axios.cjs": "./dist/browser/axios.cjs",
|
||||
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
||||
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
|
||||
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
|
||||
},
|
||||
"react-native": {
|
||||
"./dist/node/axios.cjs": "./dist/browser/axios.cjs",
|
||||
"./lib/adapters/http.js": "./lib/helpers/null.js",
|
||||
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
|
||||
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user