uniswap-interface-uncensored/src/polyfills.ts
Zach Pomerantz fe6df38997
build: upgrade to webpack5 with polyfilled Buffer (#6568)
* fix: Revert "fix: Revert "build: upgrade to webpack 5 (#6459)" (#6566)"

This reverts commit 5e591455b38c9618c750a23bc2a63cdcc30dba57.

* build: polyfill Buffer

* docs: fix comment negation
2023-05-15 14:07:05 -07:00

24 lines
436 B
TypeScript

import 'polyfill-object.fromentries'
import { ResizeObserver } from '@juggle/resize-observer'
import flat from 'array.prototype.flat'
import flatMap from 'array.prototype.flatmap'
import { Buffer } from 'buffer'
flat.shim()
flatMap.shim()
declare global {
interface Window {
Buffer: typeof Buffer
}
}
if (!window.Buffer) {
window.Buffer = Buffer
}
if (!window.ResizeObserver) {
window.ResizeObserver = ResizeObserver
}