A Rollup plugin (v1.0.5) that resolves TypeScript path aliases defined in tsconfig.json to their actual file paths during bundling. It allows developers to use TypeScript's paths feature with Rollup, enabling clean imports like `import { Foo } from 'foo'` which maps to a source file path. The plugin is lightweight, has no external runtime dependencies, and must be placed before other Rollup plugins like commonjs to ensure correct resolution. However, it only supports the first entry in a paths array, and it is primarily useful for projects that first compile with tsc and then bundle with Rollup. The package ships TypeScript types and is maintained on GitHub.
npm install rollup-plugin-ts-pathsVerified import paths — ran on the pinned version, not inferred.
Basic Rollup config using rollup-plugin-ts-paths to resolve TypeScript path aliases, placed before nodeResolve and commonjs plugins.
Ensure the first path entry is the intended one, or avoid using multiple fallback paths.
Order the plugin first in the plugins array.
Ensure tsconfig.json exists in the project root or specify tsConfigDirectory option.
Ensure tsConfigPaths() is first in plugins array and that foo is defined in tsconfig.json paths.
Use `import tsConfigPaths from 'rollup-plugin-ts-paths'`.
No dependency data recorded yet.