rslib
rslib copied to clipboard
[Feature]: bundle declarationMap
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.
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.
- In unbundle mode, you could set
compilerOptions.declarationMaptotrueto 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.