ESbuild plugin that applies import map mappings to ESM imports at build time, replacing runtime import map resolution. Version 2.1.0 (stable) is the latest release; v3.0.0 is in development with breaking changes. Key differentiators: works ahead of time, reducing runtime overhead; supports reading import maps from filesystem; integrates seamlessly with esbuild's plugin system. Alternative: using runtime import maps (native browser feature) but requires browser support and adds latency.
npm install esbuild-plugin-import-mapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Bundles an entry point, applying import map resolutions ahead of time using the default plugin instance.
Update .load() calls to pass a base URL string as the first argument, e.g., .load('https://example.com')Test all import map entries against the new spec; adjust mappings as needed.
Migrate to v3.0.0-next when it becomes stable; for now, stick with v2.1.0 if you need reliability.
Ensure all imports you want mapped are ESM-style. Use esbuild's ESM output format.
Validate import map JSON with JSON.parse() before passing to plugin.
Use import syntax in an ESM module, or set type: 'module' in package.json.
Use plugin = require('esbuild-plugin-import-map').default or import plugin from '...' and call plugin() when adding to esbuild plugins array.Strip comments or ensure the file is pure JSON before loading.
No dependency data recorded yet.