I prefer to do this trick because I want to import a.d.ts
only for tree-shaking reasons. I need the type declaration only without source code. If I directly import source code a.ts
, the tree-shaking for a.ts
will not work.
Clearly, I counld use any as a dirty resolution, but I still want to have the benefit of type check with declaration files.
I refer to the Triple-Slash Directives, but it seems not my case.