A simple esbuild plugin for replacing file content during bundling using regular expressions or string patterns. Version 0.0.2, released with basic functionality allowing multiple patterns, custom file filtering, and loader specification. Differentiates from general replace plugins by focusing on regex and integration with esbuild's build process. Lightweight with no additional dependencies beyond esbuild peer.
npm install esbuild-plugin-replace-regexNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of esbuild-plugin-replace-regex to replace version string and env variable during build.
Add g flag to regex or use string replacement for all occurrences
Use a RegExp object for filter
Import default: import replacePlugin from 'esbuild-plugin-replace-regex'
Ensure each pattern is either [search, replacement] or [regex, replaceFunction]