{"id":22266,"library":"rollup-plugin-typescript-resolve","title":"rollup-plugin-typescript-resolve","description":"Rollup plugin that resolves module imports using the TypeScript resolution algorithm, providing accurate file extension resolution and support for TypeScript path mappings (paths, baseUrl). Version 1.0.1 is stable but rarely updated; the plugin relies on TypeScript's built-in resolution logic rather than custom patterns. Unlike alternatives like rollup-plugin-typescript2, this plugin focuses exclusively on resolution and does not include compilation. Useful for projects where TypeScript handles compilation separately (e.g., via tsc). Requires TypeScript >=3.4 as a peer dependency. Releases are infrequent; consider compatibility with latest TypeScript versions.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jacobmischka/rollup-plugin-typescript-resolve#readme","tags":["javascript","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-typescript-resolve","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-typescript-resolve","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-typescript-resolve","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Uses TypeScript's module resolution API","package":"typescript","optional":false}],"imports":[{"note":"Named export only; default export does not exist.","wrong":"import typescriptResolve from 'rollup-plugin-typescript-resolve'","symbol":"typescriptResolve","correct":"import { typescriptResolve } from 'rollup-plugin-typescript-resolve'"},{"note":"CommonJS require works via destructuring.","wrong":"","symbol":"typescriptResolve","correct":"const { typescriptResolve } = require('rollup-plugin-typescript-resolve')"},{"note":"Aliasing the named export is safe; default import is wrong.","wrong":"import resolvePlugin from 'rollup-plugin-typescript-resolve'","symbol":"typescriptResolve","correct":"import { typescriptResolve as resolvePlugin } from 'rollup-plugin-typescript-resolve'"},{"note":"For type-only usage, use import type to avoid runtime inclusion.","wrong":"import { typescriptResolve } from 'rollup-plugin-typescript-resolve'","symbol":"typeof typescriptResolve","correct":"import type { typescriptResolve } from 'rollup-plugin-typescript-resolve'"}],"quickstart":{"code":"import { typescriptResolve } from 'rollup-plugin-typescript-resolve';\nimport typescript from '@rollup/plugin-typescript';\n\nexport default {\n  input: 'src/index.ts',\n  output: { dir: 'dist', format: 'esm' },\n  plugins: [\n    typescriptResolve(),\n    typescript()\n  ]\n};","lang":"typescript","description":"Basic Rollup config using TypeScript resolution before TypeScript compilation plugin."},"warnings":[{"fix":"Add a TypeScript compilation plugin after typescriptResolve in the Rollup plugins array.","message":"Plugin only resolves imports, does not compile TypeScript. You must use a separate compilation plugin like @rollup/plugin-typescript or tsc.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Migrate to @rollup/plugin-typescript if you need compilation and resolution in one package.","message":"This package may not be actively maintained; last release in 2020. Consider using @rollup/plugin-typescript which includes resolution.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Ensure TypeScript version is 3.4 or later.","message":"Requires TypeScript >=3.4. Using older TypeScript will cause import resolution errors.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Configure tsconfig.json with appropriate settings if needed.","message":"Does not support resolution of non-TypeScript files (.js, .json) unless configured via TypeScript's allowJs or resolveJsonModule.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use import { typescriptResolve } from 'rollup-plugin-typescript-resolve' instead of import typescriptResolve from '...'","message":"Version 1.0.0 changed the export from default to named. Both imports and requires must use destructured syntax.","severity":"breaking","affected_versions":">=1.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 rollup-plugin-typescript-resolve --save-dev","cause":"Package not installed.","error":"Error: Cannot find module 'rollup-plugin-typescript-resolve'"},{"fix":"Install TypeScript >=3.4 and ensure it is in the same resolution scope.","cause":"TypeScript version <3.4 or incompatible TypeScript instance.","error":"Cannot read property 'resolveModuleNames' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}