A Rollup plugin that resolves TypeScript path aliases and baseUrl in .d.ts files, converting them to relative paths. Current version 0.0.3 (2024), stable but early-stage. Designed for individual .ts file builds (not bundled .d.ts). Key differentiator: works with @rollup/plugin-typescript, not rollup-plugin-dts. Supports monorepos and auto-discovers tsconfig.json. Helps ensure type declaration portability across projects.
npm install rollup-plugin-dts-path-aliasVerified import paths — ran on the pinned version, not inferred.
Typical Rollup config using @rollup/plugin-typescript and dtsPathAlias to compile TypeScript and resolve path aliases in .d.ts files.
Place dtsPathAlias() before typescript() in the plugins array.
Use @rollup/plugin-typescript for individual file builds.
No action needed.
npm install rollup-plugin-dts-path-alias --save-dev
import dtsPathAlias from 'rollup-plugin-dts-path-alias';
Ensure tsconfig.json exists or provide cwd option.
No dependency data recorded yet.