An esbuild plugin that automatically configures the esbuild `target` option based on a browserslist query. Current stable version is 3.0.2 (released April 2026), previously v2.0.0 (November 2025). Requires esbuild ~0.28.0 and browserslist ^4.28.2 as peer dependencies. Unlike manually specifying esbuild targets, this plugin resolves browserslist queries (e.g., "defaults") into esbuild-compatible browser versions, mapping browsers like Chrome, Firefox, Safari, Edge, iOS Safari, and Node. Unknown browser targets are warned via `printUnknownTargets` option. Ships with TypeScript definitions. Pure ESM package requires Node >=20.19.0 or appropriate module resolution.
npm install esbuild-plugin-browserslistNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: pass browserslist query to the plugin and use it in esbuild's build step.
Upgrade to Node >=20.19.0 or use ESM imports. For older Node, stick with v0.x.
Install esbuild@0.28.x alongside the plugin.
Update browserslist to ^4.28.2.
Use printUnknownTargets: true to see warnings for unmapped browsers.
Do not set 'target' in esbuild.build options when using the plugin.
Add "type": "module" to package.json or use dynamic import().
Use import instead, or upgrade Node to >=20.19.0 and use --experimental-require-module.
Check the browserslist query or set printUnknownTargets: true to see which browsers are unmapped.