Skip to content

Commit

Permalink
fix: d.ts paths transform bug if project use ts 4.9.x (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Mar 16, 2023
1 parent 4563346 commit 9c35e88
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/builder/bundless/dts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ export default async function getDeclarations(
// ref: https://www.npmjs.com/package/typescript-transform-paths
const result = program.emit(undefined, undefined, undefined, true, {
afterDeclarations: [
tsPathsTransformer(program, { afterDeclarations: true }),
tsPathsTransformer(
program,
{ afterDeclarations: true },
// specific typescript instance, because this plugin is incompatible with typescript@4.9.x currently
// but some project may declare typescript and some dependency manager will hoist project's typescript
// rather than father's typescript for this plugin
{ ts },
),
],
});

Expand Down

0 comments on commit 9c35e88

Please sign in to comment.