Package Exports
- esbuild-plugin-polyfill-node
Readme
esbuild-plugin-polyfill-node
ESBuild plugin to polyfill Node.js built-ins geared towards edge environments.
Installation
npm install esbuild-plugin-polyfill-nodeUsage
import { build } from "esbuild";
import { nodePolyfills } from "esbuild-plugin-polyfill-node";
build({
entryPoints: ["src/index.js"],
bundle: true,
outfile: "dist/bundle.js",
plugins: [nodePolyfills()],
});Provided polyfills
_buffer_listas implemented inreadable-stream_stream_passthroughas implemented inreadable-stream_stream_readableas implemented inreadable-stream_stream_transformas implemented inreadable-stream_stream_writableas implemented inreadable-streamassertas implemented inassertbufferas implemented inbuffer-es6consoleas implemented inconsole-browserifydomainas implemented indomain-browsereventsas implemented ineventshttpas implemented instream-httphttpsas implemented instream-httposas implemented inospathas implemented inpathprocessas implemented inprocess-es6punycodeas implemented inpunycodequerystringas implemented inquerystringstreamas implemented instreamstring_decoderas implemented instring_decodersysas implemented inutiltimersas implemented intimers-browserifyttyas implemented intty-browserifyurlas implemented inurlutilas implemented inutilvmas implemented invm-browserifyzlibas implemented inbrowserify-zlib
Shimmed globals
global(aliased toglobalThis)processBuffer__dirname(always"/")__filename(always"/index.js")
Empty polyfills
dnsdgramchild_processclustermodulenetreadlinerepltlsfscrypto
Credits
- Fatih Aygün, under the MIT license
- Loosely based on rollup-plugin-polyfill-node