Skip to content

Commit

Permalink
arm-compute: fix new warning
Browse files Browse the repository at this point in the history
  • Loading branch information
witemple-msft committed Jan 12, 2022
1 parent a75eca0 commit fe81f4c
Showing 1 changed file with 1 addition and 64 deletions.
65 changes: 1 addition & 64 deletions sdk/compute/arm-compute/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,6 @@ import json from "@rollup/plugin-json";

import nodeBuiltins from "builtin-modules";

/**
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
*
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
* __exportStar downleveled helper function to declare its exports which confuses
* rollup's automatic discovery mechanism.
*
* @returns an object reference that can be `...`'d into your cjs() configuration.
*/
export function openTelemetryCommonJs() {
const namedExports = {};

for (const key of [
"@opentelemetry/api",
"@azure/core-tracing/node_modules/@opentelemetry/api"
]) {
namedExports[key] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"SpanStatusCode",
"getSpanContext",
"setSpanContext"
];
}

const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];

for (const version of releasedOpenTelemetryVersions) {
namedExports[
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
] = [
"SpanKind",
"TraceFlags",
"getSpan",
"setSpan",
"StatusCode",
"CanonicalCode",
"getSpanContext",
"setSpanContext"
];
}

return namedExports;
}

// #region Warning Handler

/**
Expand Down Expand Up @@ -122,22 +74,7 @@ function makeBrowserTestConfig() {
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs({
namedExports: {
// Chai's strange internal architecture makes it impossible to statically
// analyze its exports.
chai: [
"version",
"use",
"util",
"config",
"expect",
"should",
"assert"
],
...openTelemetryCommonJs()
}
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
Expand Down

0 comments on commit fe81f4c

Please sign in to comment.