Skip to content

Commit f46cff3

Browse files
authored
[core] Fix core-http and core-asynciterator-polyfill packaging issue (Azure#15286)
- .map files are now included - change the esm output directory of core-http to dist-esm to align with other client libraries in this repository
1 parent 2edd1dc commit f46cff3

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

sdk/core/core-asynciterator-polyfill/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"main": "./dist-esm/index.js",
1818
"files": [
1919
"dist-esm/index.js",
20+
"dist-esm/index.js.map",
2021
"README.md",
2122
"LICENSE"
2223
],

sdk/core/core-http/package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"cloud"
2929
],
3030
"main": "dist/index.js",
31-
"module": "./es/src/coreHttp.js",
31+
"module": "./dist-esm/src/coreHttp.js",
3232
"types": "./types/latest/src/coreHttp.d.ts",
3333
"typesVersions": {
3434
"<3.6": {
@@ -38,25 +38,23 @@
3838
}
3939
},
4040
"files": [
41-
"dist/**/*.node.js",
42-
"dist/**/*.node.js.map",
41+
"dist/",
42+
"dist-esm/src/",
4343
"dom-shim.d.ts",
44-
"es/src/**/*.js",
45-
"es/src/**/*.js.map",
4644
"types/*/src/**/*.d.ts",
4745
"types/*/src/**/*.d.ts.map",
4846
"README.md",
4947
"LICENSE"
5048
],
5149
"browser": {
52-
"./es/src/policies/msRestUserAgentPolicy.js": "./es/src/policies/msRestUserAgentPolicy.browser.js",
53-
"./es/src/policies/disableResponseDecompressionPolicy.js": "./es/src/policies/disableResponseDecompressionPolicy.browser.js",
54-
"./es/src/policies/proxyPolicy.js": "./es/src/policies/proxyPolicy.browser.js",
55-
"./es/src/util/base64.js": "./es/src/util/base64.browser.js",
56-
"./es/src/util/xml.js": "./es/src/util/xml.browser.js",
57-
"./es/src/defaultHttpClient.js": "./es/src/defaultHttpClient.browser.js",
58-
"./es/src/util/inspect.js": "./es/src/util/inspect.browser.js",
59-
"./es/src/util/url.js": "./es/src/util/url.browser.js"
50+
"./dist-esm/src/policies/msRestUserAgentPolicy.js": "./dist-esm/src/policies/msRestUserAgentPolicy.browser.js",
51+
"./dist-esm/src/policies/disableResponseDecompressionPolicy.js": "./dist-esm/src/policies/disableResponseDecompressionPolicy.browser.js",
52+
"./dist-esm/src/policies/proxyPolicy.js": "./dist-esm/src/policies/proxyPolicy.browser.js",
53+
"./dist-esm/src/util/base64.js": "./dist-esm/src/util/base64.browser.js",
54+
"./dist-esm/src/util/xml.js": "./dist-esm/src/util/xml.browser.js",
55+
"./dist-esm/src/defaultHttpClient.js": "./dist-esm/src/defaultHttpClient.browser.js",
56+
"./dist-esm/src/util/inspect.js": "./dist-esm/src/util/inspect.browser.js",
57+
"./dist-esm/src/util/url.js": "./dist-esm/src/util/url.browser.js"
6058
},
6159
"license": "MIT",
6260
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-http/README.md",

sdk/core/core-http/rollup.base.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { openTelemetryCommonJs } from "@azure/dev-tool/shared-config/rollup";
1111
const pkg = require("./package.json");
1212
const depNames = Object.keys(pkg.dependencies);
1313
const devDepNames = Object.keys(pkg.devDependencies);
14-
const input = "./es/src/coreHttp.js";
14+
const input = "./dist-esm/src/coreHttp.js";
1515
const production = process.env.NODE_ENV === "production";
1616

1717
export function nodeConfig(test = false) {
@@ -36,7 +36,7 @@ export function nodeConfig(test = false) {
3636

3737
if (test) {
3838
// Entry points - test files under the `test` folder(common for both browser and node), node specific test files
39-
baseConfig.input = ["es/test/**/*[^browser.].js"];
39+
baseConfig.input = ["dist-esm/test/**/*[^browser.].js"];
4040
baseConfig.plugins.unshift(multiEntry({ exports: false }));
4141

4242
// different output file
@@ -61,7 +61,7 @@ export function browserConfig(test = false, production = false) {
6161
input: input,
6262
external: [],
6363
output: {
64-
file: "./dist/index.browser.js",
64+
file: "./dist-browser/core-http.js",
6565
format: "umd",
6666
name: "Azure.Core.HTTP",
6767
sourcemap: true
@@ -93,7 +93,7 @@ export function browserConfig(test = false, production = false) {
9393

9494
if (test) {
9595
// Entry points - test files under the `test` folder(common for both browser and node), browser specific test files
96-
baseConfig.input = ["es/test/**/*[^node.].js"];
96+
baseConfig.input = ["dist-esm/test/**/*[^node.].js"];
9797
baseConfig.plugins.unshift(multiEntry({ exports: false }));
9898
baseConfig.output.file = "dist-test/coreHttp.browser.test.js";
9999
baseConfig.external.push("fetch-mock");

sdk/core/core-http/tsconfig.es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "es6",
5-
"outDir": "es"
5+
"outDir": "dist-esm"
66
}
77
}

0 commit comments

Comments
 (0)