rslib icon indicating copy to clipboard operation
rslib copied to clipboard

[Feature]: bundle declarationMap

Open ImSingee opened this issue 10 months ago • 2 comments

What problem does this feature solve?

https://www.typescriptlang.org/tsconfig/#declarationMap

It's crucial for using rslib in monorepo that nearly all IDE (VS Code, JetBrains, etc.) relies on this to provide a correct "jump to definition" feature

What does the proposed API look like?

I think it's enough that just add a declarationMap: true option to output config.

ImSingee avatar Mar 11 '25 07:03 ImSingee

Type-related configurations are all gathered in tsconfig.json, you can configure directly in tsconfig.json.

We don't plan to make this a default option since we want users choose whether to enable it.

Timeless0911 avatar Mar 11 '25 07:03 Timeless0911

  • In unbundle mode, you could set compilerOptions.declarationMap to true to emit the map, Rslib will do nothing here.
  • In bundle mode, we use api-extractor to bundle the d.ts files, tracked in https://github.com/microsoft/rushstack/issues/1886.

fi3ework avatar Mar 12 '25 03:03 fi3ework