-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Description
TLDR:
Oh, yeah I don't think we will ever export that.
Is your feature request related to a problem? Please describe.
Yes. I'm writing a adaptor to be used in userscript like tampermonkey or Violentmonkey,
it use a xhr provided be broser extension GM.xmlHttpRequest to make cors request.
And to make it behavior like axios' xhr adaptor, I'm using some axios' helper functions directly by
import buildFullPath from "axios/lib/core/buildFullPath";
import settle from "axios/lib/core/settle";
import buildURL from "axios/lib/helpers/buildURL";
import parseHeaders from "axios/lib/helpers/parseHeaders";
import utils from "axios/lib/utils";But after axios 1.0.0 is released, a exports field is added to package.json, and lib directory is no longer exported anymore, this make me unable to use helper function provided by axios anymore.
Lines 6 to 17 in 484aa4f
| "exports": { | |
| ".": { | |
| "browser": { | |
| "require": "./index.js", | |
| "default": "./index.js" | |
| }, | |
| "default": { | |
| "require": "./dist/node/axios.cjs", | |
| "default": "./index.js" | |
| } | |
| } | |
| }, |
modern js bundler will raise a error for this: Package subpath './lib/core/buildFullPath' is not defined by "exports" in .../node_modules/axios/package.json by bundler.
Describe the solution you'd like
add lib dir to package.json#exports