{"id":26605,"library":"vite-resolve-tsconfig-paths","title":"vite-resolve-tsconfig-paths","description":"A Vite plugin that resolves TypeScript compilerOptions.paths, supporting tsconfig extends and references in subdirectories. Current stable version is 0.0.10. The plugin uses tsconfck to parse all tsconfig.json project files, including references, and creates resolvers based on the compiled paths. It differentiates from alternatives like vite-tsconfig-paths by supporting extends and references in sub-folders out of the box. Release cadence is irregular with a few minor versions since its inception. The plugin is TypeScript-first, ships types, and requires Vite as a peer dependency.","status":"active","version":"0.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/sebtoombs/vite-resolve-tsconfig-paths","tags":["javascript","vite","plugin","resolve","resolver","tsconfig","paths","typescript","compilerOptions.paths"],"install":[{"cmd":"npm install vite-resolve-tsconfig-paths","lang":"bash","label":"npm"},{"cmd":"yarn add vite-resolve-tsconfig-paths","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-resolve-tsconfig-paths","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency; the plugin is designed to work as a Vite plugin.","package":"vite","optional":false}],"imports":[{"note":"The package is ESM-only; CommonJS require will fail. Use import syntax.","wrong":"const tsConfigPaths = require('vite-resolve-tsconfig-paths')","symbol":"tsConfigPaths","correct":"import { tsConfigPaths } from 'vite-resolve-tsconfig-paths'"},{"note":"There is no default export; the only exported symbol is 'tsConfigPaths'. The alternative name 'viteResolveTsconfigPaths' is not provided.","wrong":"import viteResolveTsconfigPaths from 'vite-resolve-tsconfig-paths'","symbol":"viteResolveTsconfigPaths","correct":"import { tsConfigPaths } from 'vite-resolve-tsconfig-paths'"},{"note":"The module does not have a default export. Always use named import for tsConfigPaths.","wrong":"import viteResolveTsconfigPaths from 'vite-resolve-tsconfig-paths'","symbol":"default","correct":"import { tsConfigPaths } from 'vite-resolve-tsconfig-paths'"}],"quickstart":{"code":"// Install: npm install -D vite-resolve-tsconfig-paths\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { tsConfigPaths } from 'vite-resolve-tsconfig-paths';\n\nexport default defineConfig({\n  plugins: [tsConfigPaths()]\n});\n// Ensure your tsconfig.json has paths configured, e.g.:\n// {\n//   \"compilerOptions\": {\n//     \"baseUrl\": \".\",\n//     \"paths\": {\n//       \"@/*\": [\"src/*\"]\n//     }\n//   }\n// }","lang":"typescript","description":"Shows how to install and use vite-resolve-tsconfig-paths in a Vite project with TypeScript."},"warnings":[{"fix":"Convert to ESM by using import syntax or setting type: 'module' in package.json.","message":"The plugin is ESM-only; using require() will throw an error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use import { tsConfigPaths } from 'vite-resolve-tsconfig-paths'.","message":"The plugin only exports a single named export: tsConfigPaths. Importing default or other names will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure a valid tsconfig.json with 'compilerOptions.paths' exists in the project root.","message":"The plugin will not resolve paths if tsconfig.json does not exist or is misconfigured.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin the exact version in package.json and test upgrades carefully.","message":"The plugin is in early development (v0.0.x); API may change without notice.","severity":"gotcha","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace require('vite-resolve-tsconfig-paths') with import { tsConfigPaths } from 'vite-resolve-tsconfig-paths' and ensure your project uses ESM.","cause":"The package is ESM-only and cannot be required with require().","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported."},{"fix":"Change import to import { tsConfigPaths } from 'vite-resolve-tsconfig-paths'.","cause":"Trying to import a default export that does not exist.","error":"The requested module 'vite-resolve-tsconfig-paths' does not provide an export named 'default'"},{"fix":"Install Vite: npm install -D vite.","cause":"Vite is a peer dependency and must be installed separately.","error":"Cannot find module 'vite' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}