Fix build for esm/cjs warning additions (#1896)

This commit is contained in:
Jaco
2023-11-17 21:44:51 +02:00
committed by GitHub
parent b9be030f12
commit f14d2681b1
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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:
+1 -1
View File
@@ -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;