diff --git a/package.json b/package.json index dbe032b59e..3958a2dfd9 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,15 @@ "default": "./index.js" } }, + "./unsafe/*": "./lib/*", + "./unsafe/core/settle.js": "./lib/core/settle.js", + "./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js", + "./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js", + "./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js", + "./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js", + "./unsafe/adapters/http.js": "./lib/adapters/http.js", + "./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js", + "./unsafe/utils.js": "./lib/utils.js", "./package.json": "./package.json" }, "type": "module", @@ -29,6 +38,7 @@ "test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit", "test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit", "test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run", + "test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run", "test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs", "test:build:version": "node ./bin/check-build-version.js", "start": "node ./sandbox/server.js", @@ -203,4 +213,4 @@ "@commitlint/config-conventional" ] } -} \ No newline at end of file +} diff --git a/test/module/esm/index.js b/test/module/esm/index.js index 89d85bc1c6..dd88761709 100644 --- a/test/module/esm/index.js +++ b/test/module/esm/index.js @@ -1,5 +1,6 @@ import assert from 'assert'; import axios, {CanceledError, AxiosError, AxiosHeaders} from 'axios'; +import settle from 'axios/unsafe/core/settle.js'; assert.strictEqual(typeof axios, 'function'); assert.strictEqual(typeof CanceledError, 'function'); @@ -10,4 +11,6 @@ assert.strictEqual(axios.CanceledError, CanceledError); assert.strictEqual(axios.AxiosError, AxiosError); assert.strictEqual(axios.AxiosHeaders, AxiosHeaders); +assert.strictEqual(typeof settle, 'function'); + console.log('ESM importing test passed');