typescript import *d.ts only instead of source code *.ts

142 Views Asked by At

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.

0

There are 0 best solutions below