A Rollup plugin that replaces @rollup/plugin-node-resolve and TypeScript paths resolution plugins with esbuild's own resolution algorithm. Version 1.3.1 is current and stable, with infrequent releases. It reads the closest tsconfig.json from each importer, enabling correct resolution across multiple interconnected projects with their own tsconfig files. Supports all esbuild resolution options (platform, conditions, mainFields, etc.) and works alongside other resolve plugins. Ships TypeScript types.
npm install rollup-plugin-esbuild-resolveVerified import paths — ran on the pinned version, not inferred.
Minimal Rollup config using esbuildResolve plugin with custom esbuild options for node platform and extended resolve extensions.
Change import to `import { esbuildResolve } from 'rollup-plugin-esbuild-resolve'`.Wrap esbuild-specific options in `esbuild` object: `esbuildResolve({ esbuild: { platform: 'node' } })`.Explicitly set the `tsconfig` option to a specific file path if you need consistent single tsconfig behavior: `esbuildResolve({ esbuild: { tsconfig: './tsconfig.json' } })`.Ensure `esbuild` version ^0.19.10 and `rollup` version ^2.79.1 || ^3.0.0 || ^4.0.0 are installed.
Upgrade Rollup to v2.79.1 or later, or use v3/v4.
Run `npm install esbuild --save-dev` or `yarn add esbuild --dev`.
Use `import { esbuildResolve } from 'rollup-plugin-esbuild-resolve'` (ESM) or `const { esbuildResolve } = require('rollup-plugin-esbuild-resolve')` (CJS).Update `rollup-plugin-esbuild-resolve` to v1.3.0 or later.
Check esbuild options passed to the plugin (platform, resolveExtensions, conditions). Ensure the module is installed. Optionally fallback to @rollup/plugin-node-resolve.