Skip to content

Commit

Permalink
Merge pull request #32 from HashMapsData2Value/fix/global-window
Browse files Browse the repository at this point in the history
fix: global window
  • Loading branch information
HashMapsData2Value authored Sep 17, 2024
2 parents 4e211c8 + 7c59edf commit da6ec22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Binary file modified bun.lockb
Binary file not shown.
7 changes: 1 addition & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// Polyfill for `global`
window.global = window;

// Polyfill for `Buffer`
import { Buffer } from "buffer";
window.Buffer = Buffer;
import './polyfills';

import ReactDOM from "react-dom/client";
import { RouterProvider } from "react-router-dom";
Expand Down
8 changes: 8 additions & 0 deletions src/polyfills.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Polyfill for `global`
if (typeof global === 'undefined') {
window.global = window;
}

// Polyfill for `Buffer`
import { Buffer } from "buffer";
window.Buffer = Buffer;

0 comments on commit da6ec22

Please sign in to comment.