An esbuild plugin (v2.0.0, last updated 2023) that allows you to replace module import paths during bundling. It intercepts resolve calls and swaps dependencies, useful for mocking or aliasing in tests or builds. Differentiators: lightweight, no dependencies, regex-based matching. Released as v1.0.0 in 2022, with v2.0.0 switching to ES modules. Maintenance-mode with no recent commits.
npm install esbuild-plugin-resolveNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to bundle with esbuild and replace 'lodash' imports with 'lodash-es' using the plugin.
Use ESM imports (import resolve from ...) or downgrade to v1.x.
Check plugin API: in v2.0.0, options might be different. Refer to the repository's usage examples.
Escape regex-special characters in the module name, e.g., use 'lodash\.merge' instead of 'lodash.merge'.
Upgrade to v1.1.0 or later.
Run 'npm install --save-dev esbuild-plugin-resolve' and use valid import syntax for your module system.
Use 'import resolve from "esbuild-plugin-resolve"' instead of 'import { resolve } from "esbuild-plugin-resolve"'.Call resolve() with options: plugins: [resolve({ test: 'foo' })].No dependency data recorded yet.