Vite plugin (v0.1.1) that enables import map-like path resolution by environment variable (mark). Allows conditional module replacement per build target using string suffix conventions, arrays, or JSON config files. Unlike standard Vite resolve aliases, it switches between file variants based on a single mark. Minimal API surface, ESM-only, ships TypeScript definitions. Release cadence is low; single maintainer. Suitable for multi-tenant or configurable builds.
npm install vite-plugin-importmapVerified import paths — ran on the pinned version, not inferred.
Configures vite-plugin-importmap with an environment-based 'mark' to switch resolved file variants.
Set VITE_OPEN_TYPE environment variable or pass a string directly to importmap().
Use static imports; avoid dynamic import() for variant switching.
Ensure file variants match the pattern: baseName.<variant>.ext for string mode, or baseName[v1,v2].ext for array mode.
Change to `import importmap from 'vite-plugin-importmap'` and ensure vite.config.js uses ESM or type: module in package.json.
Call `importmap(mark)` with a string argument; e.g., `importmap('v1')`.Ensure the variant file exists with the correct naming pattern (e.g., test.v1.js) or adjust the mark value.
No dependency data recorded yet.