Skip to content

Commit

Permalink
Fix build for esm/cjs warning additions (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored Nov 17, 2023
1 parent b9be030 commit f14d268
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Contributed:

- Ledger support for Quartz (Thanks to https://github.com/CertainLach)
- Add flag to disable same-version esm/cjs warnings (Thanks to https://github.com/forgetso)

Changes:

Expand Down
2 changes: 1 addition & 1 deletion packages/util/src/versionDetect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export function detectPackage ({ name, path, type, version }: PackageInfo, pathO
// if we have more than one entry at DIFFERENT version types then warn. If there is more than one entry at the same
// version and ESM/CJS dual warnings are disabled, then do not display warnings
const entriesSameVersion = entry.every((e) => e.version === version);
const esmCjsWarningDisabled = POLKADOTJS_DISABLE_ESM_CJS_WARNING_FLAG in process.env && process.env[POLKADOTJS_DISABLE_ESM_CJS_WARNING_FLAG] === '1';
const esmCjsWarningDisabled = xglobal.process?.env?.[POLKADOTJS_DISABLE_ESM_CJS_WARNING_FLAG] === '1';
const multipleEntries = entry.length !== 1;
const disableWarnings = esmCjsWarningDisabled && entriesSameVersion;

Expand Down

0 comments on commit f14d268

Please sign in to comment.