Provides Node.js built-in module polyfills for esbuild bundler, similar to Webpack's 'node' option. Version 1.0.2 (latest, 2021) is stable but unmaintained since. Requires manual installation of peer dependencies: browserify-zlib, buffer, crypto-browserify, events, https-browserify, os-browserify, path-browserify, process, stream-browserify, stream-http, url, util. Compared to alternatives like @esbuild-plugins/node-globals-polyfills, this plugin offers a more complete set of polyfills but lacks ESM support and TypeScript definitions.
npm install esbuild-plugin-node-polyfillsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure esbuild with the node polyfills plugin using CommonJS.
Run: npm install browserify-zlib buffer crypto-browserify events https-browserify os-browserify path-browserify process stream-browserify stream-http url util
Use require() instead of import.
Consider using @esbuild-plugins/node-globals-polyfills for more controlled polyfilling.
npm install buffer
Change to: const ESBuildNodePolyfillsPlugin = require('esbuild-plugin-node-polyfills');