esbuild plugin for compiling TypeScript declaration files (.d.ts) with path alias transformation. Version 4.2.1 (latest) requires esbuild ^0.17.0, TypeScript >=5, and Node >=16.10.0. It resolves path aliases like '@utils/foo' into relative import paths in the output .d.ts files, solving a common pain point when using path aliases in TypeScript projects. It offers configurable tsconfig path, output directory, and debug logging. As a fork of esbuild-plugin-d-ts-alias, it maintains compatibility with recent esbuild and TypeScript versions. The plugin is ESM-only and ships TypeScript declarations.
npm install esbuild-dts-path-aliasNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: include the plugin in esbuild build config to transform path aliases in .d.ts files.
Upgrade TypeScript to >=5 and esbuild to >=0.17.0, and Node to >=16.10.0.
Use dynamic import() or switch to ESM project configuration. For CommonJS require, pin to v3.x.
Monitor the GitHub repository for updates or consider forking as needed.
Switch to ESM (set type: module in package.json or use .mjs extension) and use import syntax.
Install the package: npm install esbuild-plugin-d-ts-path-alias --save-dev. Ensure tsconfig.json has "moduleResolution": "node16" or "bundler".
Provide explicit tsconfigPath option to dTSPathAliasPlugin({ tsconfigPath: './path/to/tsconfig.json' }) or ensure default tsconfig.json exists at project root.