This confuses me. You either write the d.ts manually before build, which only makes sense if you wrote the original code in JavaScript (not Typescript) or you write the source in Typescript and enable the declaration option in your tsconfig and the d.ts pops out in seconds along with your final JS output.
Unless you are using transpileOnly, generating declarations will not make a few second build become a few hours-- Typescript is already type checking your code.