esbuild-x is a thin wrapper around esbuild (currently v0.4.2) that adds support for configuration files (esbuild.config.js) and custom pre-build / post-build function hooks. It ships with built-in post-build helpers including file copy with glob patterns, HTML injection of esbuild outputs, and CSS/HTML minification plugins. Unlike bare esbuild, it allows developers to run arbitrary tasks (like cleanup, asset copying, or bundle analysis) before and after the main build without wiring separate tools. The release cadence is low/irregular; it's a small utility rather than a major framework.
npm install esbuild-xNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows a complete build task with pre-cleanup and post-copy with replacements, using esbuild-x hooks.
Chain `.catch(err => ...)` after calling `esbuildX.build(...)`.
Verify each replacement object has `match`, `find`, and `replace` fields. The `match` pattern must match the file path to apply the replacement.
Ensure your index.html uses the exact placeholder script/links. Alternatively, configure esbuild's outdir and use a separate copy step.
Use the Node API for reliable behavior; the CLI is undocumented beyond basic usage.
Use `const esbuildX = require('esbuild-x');` then `esbuildX.build(...)`.Run `npm install esbuild-x --save-dev` and ensure node_modules contains it.
Access via `require('esbuild-x').plugins` or `require('esbuild-x').postBuilds`.Add `outdir: 'dist'` (or your desired output directory) to the build options object.