Skip to content

Commit

Permalink
fix module variable in CJS (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Jul 2, 2024
1 parent d47d9bd commit 2a1a6b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-windows-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Fixed a CommonJS-related error where an internal variable was accidentally trying to override the [`module`](https://nodejs.org/api/modules.html#the-module-object) object.
4 changes: 2 additions & 2 deletions packages/itwinui-react/src/utils/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { version } from '../styles.js';

const module: 'ESM' | 'CJS' =
const _moduleType: 'ESM' | 'CJS' =
// @ts-expect-error: __module gets injected by SWC
typeof __module !== 'undefined' ? __module : 'DEV';

Expand All @@ -13,5 +13,5 @@ export const meta = {
/** The exact version of `@itwin/itwinui-react`. */
version,
/** The current module format (i.e. "ESM" vs "CJS"). */
module,
module: _moduleType,
};

0 comments on commit 2a1a6b5

Please sign in to comment.