Skip to content

Commit 00244fd

Browse files
committed
🐛 improve check on node
1 parent ae213ba commit 00244fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/tools/globalObject.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ export const globalObject = getGlobalObject<GlobalObject>()
5050

5151
export const isBrowserEnvironment = 'document' in globalObject
5252
export const isWorkerEnvironment = 'WorkerGlobalScope' in globalObject
53-
export const isNodeEnvironment = 'process' in globalObject
53+
// @ts-expect-error module is undefined outside of Node.
54+
export const isNodeEnvironment = typeof module !== 'undefined' && module.exports

0 commit comments

Comments
 (0)