Registry / devops / rollup-plugin-esbuild-transform

rollup-plugin-esbuild-transform

JSON →
library1.5.0jsnpmunverified

Rollup plugin that leverages esbuild's transform API to process files of any supported type (JS, JSX, TS, TSX, JSON, CSS, etc.) before bundling. Version 1.5.0 is the latest stable release, actively maintained. Unlike rollup-plugin-esbuild, this plugin allows multiple loader configurations with per-pattern esbuild options, supports both pre-bundle and post-bundle (output) transforms, and exposes all esbuild TransformOptions including tsconfig path resolution. Ships TypeScript declarations. Requires esbuild >=0.10.1 and Rollup 1.x/2.x.

npm install rollup-plugin-esbuild-transform
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ESBU
R
rollup-plugin-esbuild-transform
devopsjavascriptv1.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import esbuild from 'rollup-plugin-esbuild-transform'
const esbuild = require('rollup-plugin-esbuild-transform')
Plugin exports a default function. CommonJS require is possible but less idiomatic in modern Rollup configs.
Options
import type { Options } from 'rollup-plugin-esbuild-transform'
import { Options } from 'rollup-plugin-esbuild-transform'
Options is a type-only export; import with `type` in TypeScript to avoid runtime issues.
TransformOptions
import type { TransformOptions } from 'rollup-plugin-esbuild-transform'
import { TransformOptions } from 'rollup-plugin-esbuild-transform'
TransformOptions is a type alias for esbuild's TransformOptions extended with tsconfig.

Configures the plugin to transform .ts files using a tsconfig, handle .js files, and minify the final bundle output.

import esbuild from 'rollup-plugin-esbuild-transform'; export default { input: 'src/index.ts', output: { file: 'dist/bundle.js', format: 'esm' }, plugins: [ esbuild([ { loader: 'ts', include: /\.ts$/, tsconfig: './tsconfig.json' }, { loader: 'js' }, { output: true, minify: true, target: 'es2015' }, ]), ], };
Debug
Known issues
breakingPlugin options `output` changes behavior: when `true`, `include` and `exclude` apply to the output chunk filename, not individual module files.
fix
Ensure to set `output: true` only for options intended for post-bundle transformation; separate pre-bundle and post-bundle configurations into distinct entries in the array.
affects: >=0.0.1
gotchaWhen multiple array entries match the same file, options are shallowly merged — `loader` from the first matching entry is kept, other options from later entries can override without warning.
fix
Order entries carefully; the first matching entry's `loader` takes precedence, but other options (e.g., `target`, `tsconfig`) will be overwritten by later matches.
affects: >=0.0.1
gotcha`tsconfig` option is ignored if `tsconfigRaw` is provided in the same options entry.
fix
Provide either `tsconfig` (path string) or `tsconfigRaw` (object), not both. If both are given, `tsconfigRaw` takes precedence.
affects: >=0.0.1
deprecatedRollup 1.x support is deprecated; plugin peer dependency allows ^1.20.0 but future versions may drop it.
fix
Migrate to Rollup 2.x or 3.x as soon as possible.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'esbuild'
esbuild is a peer dependency but not installed.
fix
Run `npm install -D esbuild` alongside this plugin.
TypeError: esbuild is not a function
Importing incorrectly (e.g., using named import instead of default).
fix
Use `import esbuild from 'rollup-plugin-esbuild-transform'` (default import).
The plugin 'esbuild' is not allowed to emit files after bundle generation
Using `output: true` in an array entry but the plugin is not the last plugin or does not work with Rollup's output phase.
fix
Ensure the entry with `output: true` is intended for post-bundle transforms and that the plugin is properly set up to handle both phases; check Rollup plugin ordering.
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency; provides the transform API used by the plugin.
rolluprequiredPeer dependency; the plugin is designed for Rollup bundler.
Agent activity
6 hits · last 30 days
node
4
Resources
rollup-plugin-esbuild-transform — npm install rollup-plugin-esbuild-transform · libregistry