A Rollup plugin that replaces TypeScript path aliases with relative paths after compilation using tsc-alias. Version 1.1.4 is the latest stable release. It integrates seamlessly into Rollup's build pipeline, reading aliases from tsconfig.json and rewriting import paths in the output bundle. Unlike manual path resolution, this plugin automates the mapping of TypeScript paths (e.g., @/components) to relative paths, ensuring compatibility with CommonJS and ESM output. It supports watch mode, custom config file paths, and options for declaration directories. The plugin is lightweight, with only Rollup as a peer dependency, and is actively maintained.
npm install rollup-plugin-tsc-aliasVerified import paths — ran on the pinned version, not inferred.
Basic Rollup configuration integrating rollup-plugin-tsc-alias to resolve TypeScript path aliases in ESM output.
Ensure the TypeScript plugin (e.g., @rollup/plugin-typescript) comes before tscAlias in the plugins array.
Remove the 'silent' option from configuration. Use 'verbose' for output control.
Set resolveFullPaths: true in tscAlias options when using wildcard aliases and targeting ESM format.
Verify that tsconfig.json contains correct paths mapping and that the alias matches the import statement exactly.
Ensure configFile option points to a valid tsconfig.json file with compilerOptions.paths defined.
Remove the 'silent' key from the options object passed to tscAlias().