{"id":22008,"library":"rollup-plugin-esbuild-transform","title":"rollup-plugin-esbuild-transform","description":"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.","status":"active","version":"1.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/exuanbo/rollup-plugin-esbuild-transform","tags":["javascript","rollup","esbuild","rollup-plugin","rollup-plugin-esbuild","rollup-plugin-esbuild-transform","typescript"],"install":[{"cmd":"npm install rollup-plugin-esbuild-transform","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-esbuild-transform","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-esbuild-transform","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; provides the transform API used by the plugin.","package":"esbuild","optional":false},{"reason":"Peer dependency; the plugin is designed for Rollup bundler.","package":"rollup","optional":false}],"imports":[{"note":"Plugin exports a default function. CommonJS require is possible but less idiomatic in modern Rollup configs.","wrong":"const esbuild = require('rollup-plugin-esbuild-transform')","symbol":"default","correct":"import esbuild from 'rollup-plugin-esbuild-transform'"},{"note":"Options is a type-only export; import with `type` in TypeScript to avoid runtime issues.","wrong":"import { Options } from 'rollup-plugin-esbuild-transform'","symbol":"Options","correct":"import type { Options } from 'rollup-plugin-esbuild-transform'"},{"note":"TransformOptions is a type alias for esbuild's TransformOptions extended with tsconfig.","wrong":"import { TransformOptions } from 'rollup-plugin-esbuild-transform'","symbol":"TransformOptions","correct":"import type { TransformOptions } from 'rollup-plugin-esbuild-transform'"}],"quickstart":{"code":"import esbuild from 'rollup-plugin-esbuild-transform';\n\nexport default {\n  input: 'src/index.ts',\n  output: { file: 'dist/bundle.js', format: 'esm' },\n  plugins: [\n    esbuild([\n      { loader: 'ts', include: /\\.ts$/, tsconfig: './tsconfig.json' },\n      { loader: 'js' },\n      { output: true, minify: true, target: 'es2015' },\n    ]),\n  ],\n};","lang":"typescript","description":"Configures the plugin to transform .ts files using a tsconfig, handle .js files, and minify the final bundle output."},"warnings":[{"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.","message":"Plugin options `output` changes behavior: when `true`, `include` and `exclude` apply to the output chunk filename, not individual module files.","severity":"breaking","affected_versions":">=0.0.1"},{"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.","message":"When 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.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Provide either `tsconfig` (path string) or `tsconfigRaw` (object), not both. If both are given, `tsconfigRaw` takes precedence.","message":"`tsconfig` option is ignored if `tsconfigRaw` is provided in the same options entry.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Migrate to Rollup 2.x or 3.x as soon as possible.","message":"Rollup 1.x support is deprecated; plugin peer dependency allows ^1.20.0 but future versions may drop it.","severity":"deprecated","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install -D esbuild` alongside this plugin.","cause":"esbuild is a peer dependency but not installed.","error":"Error: Cannot find module 'esbuild'"},{"fix":"Use `import esbuild from 'rollup-plugin-esbuild-transform'` (default import).","cause":"Importing incorrectly (e.g., using named import instead of default).","error":"TypeError: esbuild is not a function"},{"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.","cause":"Using `output: true` in an array entry but the plugin is not the last plugin or does not work with Rollup's output phase.","error":"The plugin 'esbuild' is not allowed to emit files after bundle generation"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}