{"id":22569,"library":"vite-jsconfig-paths","title":"vite-jsconfig-paths","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/EliezerSPP/vite-tsconfig-paths","tags":["javascript","vite","resolver","jsconfig","paths"],"install":[{"cmd":"npm install vite-jsconfig-paths","lang":"bash","label":"npm"},{"cmd":"yarn add vite-jsconfig-paths","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-jsconfig-paths","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires Vite >2.0.0-0 to function.","package":"vite","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require is not supported. Use dynamic import if necessary.","wrong":"const jsconfigPaths = require('vite-jsconfig-paths')","symbol":"default","correct":"import jsconfigPaths from 'vite-jsconfig-paths'"},{"note":"The package exports a single default function; named import is incorrect.","wrong":"import { jsconfigPaths } from 'vite-jsconfig-paths'","symbol":"jsconfigPaths","correct":"import jsconfigPaths from 'vite-jsconfig-paths'"},{"note":"This package does not export TypeScript types; use vite's Plugin type for type annotations.","wrong":"","symbol":"type imports","correct":"import type { Plugin } from 'vite'"}],"quickstart":{"code":"// vite.config.js\nimport { defineConfig } from 'vite'\nimport jsconfigPaths from 'vite-jsconfig-paths'\n\nexport default defineConfig({\n  plugins: [jsconfigPaths()]\n})","lang":"typescript","description":"Quickstart showing how to add the plugin to a Vite config file with default options."},"warnings":[{"fix":"Manually restart the Vite dev server or rebuild.","message":"Restart Vite after updating jsconfig.json paths mappings for changes to take effect.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Upgrade Vite to version >2.0.0-0 or use vite-jsconfig-paths@1.x.","message":"Dropped support for vite 1.x; requires vite >2.0.0-0.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure baseUrl is set carefully and relative to project root.","message":"baseUrl resolution may accidentally resolve to files outside project root, potentially causing unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use built-in Vite debug logging or plugin-specific options if available.","message":"Debug logging via DEBUG environment variable is supported but may be removed in future versions.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run npm install vite-jsconfig-paths --save-dev and ensure import is from 'vite-jsconfig-paths'.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'vite-jsconfig-paths'"},{"fix":"Change to ESM import syntax or use dynamic import: const jsconfigPaths = (await import('vite-jsconfig-paths')).default;","cause":"Using CommonJS require with ESM-only package.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use default import: import jsconfigPaths from 'vite-jsconfig-paths'","cause":"Attempted named import instead of default import.","error":"TypeError: jsconfigPaths is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}