1.0.2 • Published 3 years ago

esbuild-plugin-node-polyfills v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ESBuild Plugin Node Polyfills

Provides NodeJS Polyfills similar to Webpack's "node" option

Usage

  1. Install Package (npm install -D esbuild-plugin-node-polyfills or yarn add --dev esbuild-plugin-node-polyfills)
  2. Install the required mocks from the peer-dependencies
  3. Use in your ESBuild Script:
const ESBuildNodePolyfillsPlugin = require("esbuild-plugin-node-polyfills");

// Your ESBuild Config
const config = {
  plugins: [ESBuildNodePolyfillsPlugin],
};

Modules with Polyfills

  • buffer
  • crypto
  • http
  • https
  • os
  • path
  • stream
  • zlib
  • url
  • events
  • process
  • util
  • _stream_duplex
  • _stream_passthrough
  • _stream_readable
  • _stream_transform
  • _stream_writable

Modules which will be resolved to false

  • tls
  • assert
  • fs
  • net