rsnext/packages/next/server/node-polyfill-web-streams.js
Shu Ding 049bb22c1c
Update polyfill of web streams (#35571)
* attach pipeTo and pipeThrough polyfills to instance

* remove transformer polyfill

* remove polyfill

* fix missing polyfill in sandbox

* always polyfill the runtime

* always polyfill web streams in renderer

* fix missing AbortController and AbortSignal

* type fix

* fix type generation

* use global

Co-authored-by: Shu Ding <shu@shus-mac-studio.localdomain>
2022-04-07 16:26:30 +02:00

12 lines
294 B
JavaScript

import {
ReadableStream,
TransformStream,
} from 'next/dist/compiled/web-streams-polyfill'
// Polyfill Web Streams for the Node.js runtime.
if (!global.ReadableStream) {
global.ReadableStream = ReadableStream
}
if (!global.TransformStream) {
global.TransformStream = TransformStream
}