esbuild plugin (v0.2.0) that allows modifying the contents of entrypoint files before they are processed by esbuild. It provides a callback function that receives the current entrypoint contents and can return modified contents along with an optional loader. Version 0.2.0 is the latest stable release, requires esbuild >=0.15 and Node.js >=18.12.0. Key differentiator: simple, focused plugin for editing entrypoint content without needing to manipulate esbuild's internal pipeline, unlike more complex alternatives.
npm install esbuild-plugin-modify-entrypointsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using the plugin with esbuild's CommonJS API to modify entrypoint contents by prepending a log statement.
Upgrade to 0.2.0 or later which provides both `contents` and `path`.
Explicitly set the `loader` field in the return value to match your content's syntax (e.g., 'ts', 'js', 'tsx').
Use the plugin on explicit entrypoints; for other files, use other esbuild plugins like svgr or CSS modules.
Always set the `loader` to avoid confusion; upgrade to 0.2.0+ for safer defaults.
Ensure your callback always returns an object with a `contents` string at minimum.
Verify the plugin is properly imported and passed in the `plugins` array.
Double-check the file path in `entryPoints` and ensure it is correct relative to the working directory.