web-infra-dev / rslib

Create JavaScript libraries in a simple and intuitive way.
https://lib.rsbuild.dev/
MIT License
407 stars 20 forks source link

[Feature]: Support for Isolated Declarations in TS 5.5 #211

Open chenjiahan opened 1 month ago

chenjiahan commented 1 month ago

What problem does this feature solve?

Since SWC already supports Isolated Declarations in TS 5.5, Rslib can provide option to enable it to speed up dts generation.

https://github.com/swc-project/swc/pull/9086

What does the proposed API look like?

Timeless0911 commented 1 month ago

Currently, swc-loader does not ship emitIsolatedDts but swc-cli do. We need to do some processing in Rspack's built-in swc-loader to emit the result of transform during build process.

And isolated declarations produce the same result with tsc's bundleless dts, we can also support using isolated emit dts for type bundle with api-extractor.