Vite plugin that resolves imports using `jsconfig.json` path mappings, enabling JavaScript projects to use TypeScript-style alias resolution without a tsconfig.json. Version 2.0.1 is current, stable, and maintained. It mirrors the functionality of vite-tsconfig-paths but for JS-only projects. Supports baseUrl, include/exclude patterns, and custom extensions. Debug logging via DEBUG environment variable is available for troubleshooting. Active development with regular updates.
npm install vite-jsconfig-pathsVerified import paths — ran on the pinned version, not inferred.
Quickstart showing how to add the plugin to a Vite config file with default options.
Manually restart the Vite dev server or rebuild.
Upgrade Vite to version >2.0.0-0 or use vite-jsconfig-paths@1.x.
Ensure baseUrl is set carefully and relative to project root.
Use built-in Vite debug logging or plugin-specific options if available.
Run npm install vite-jsconfig-paths --save-dev and ensure import is from 'vite-jsconfig-paths'.
Change to ESM import syntax or use dynamic import: const jsconfigPaths = (await import('vite-jsconfig-paths')).default;Use default import: import jsconfigPaths from 'vite-jsconfig-paths'