rollup-plugin-typescript-resolve

raw JSON →
1.0.1 verified Mon Apr 27 auth: no javascript maintenance

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.

error Error: Cannot find module 'rollup-plugin-typescript-resolve'
cause Package not installed.
fix
Run npm install rollup-plugin-typescript-resolve --save-dev
error Cannot read property 'resolveModuleNames' of undefined
cause TypeScript version <3.4 or incompatible TypeScript instance.
fix
Install TypeScript >=3.4 and ensure it is in the same resolution scope.
gotcha Plugin only resolves imports, does not compile TypeScript. You must use a separate compilation plugin like @rollup/plugin-typescript or tsc.
fix Add a TypeScript compilation plugin after typescriptResolve in the Rollup plugins array.
deprecated This package may not be actively maintained; last release in 2020. Consider using @rollup/plugin-typescript which includes resolution.
fix Migrate to @rollup/plugin-typescript if you need compilation and resolution in one package.
gotcha Requires TypeScript >=3.4. Using older TypeScript will cause import resolution errors.
fix Ensure TypeScript version is 3.4 or later.
gotcha Does not support resolution of non-TypeScript files (.js, .json) unless configured via TypeScript's allowJs or resolveJsonModule.
fix Configure tsconfig.json with appropriate settings if needed.
breaking Version 1.0.0 changed the export from default to named. Both imports and requires must use destructured syntax.
fix Use import { typescriptResolve } from 'rollup-plugin-typescript-resolve' instead of import typescriptResolve from '...'
npm install rollup-plugin-typescript-resolve
yarn add rollup-plugin-typescript-resolve
pnpm add rollup-plugin-typescript-resolve

Basic Rollup config using TypeScript resolution before TypeScript compilation plugin.

import { typescriptResolve } from 'rollup-plugin-typescript-resolve';
import typescript from '@rollup/plugin-typescript';

export default {
  input: 'src/index.ts',
  output: { dir: 'dist', format: 'esm' },
  plugins: [
    typescriptResolve(),
    typescript()
  ]
};