Skip to content

Commit 849cab2

Browse files
committed
define globalThis if not defined
1 parent 29e3c82 commit 849cab2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ const globalShimsBanner = [
9292
`import __global_polyfill from 'vite-plugin-node-polyfills/shims/global'`,
9393
`import __process_polyfill from 'vite-plugin-node-polyfills/shims/process'`,
9494
``,
95+
`globalThis = globalThis ?? window`,
9596
`globalThis.Buffer = globalThis.Buffer || __buffer_polyfill`,
9697
`globalThis.global = globalThis.global || __global_polyfill`,
9798
`globalThis.process = globalThis.process || __process_polyfill`,

0 commit comments

Comments
 (0)