Allow --emitDeclarationOnly flag to be passed in --build · Issue #51164 · microsoft/TypeScript (original) (raw)

Suggestion

🔍 Search Terms

emitDeclarationOnly build mode flag

✅ Viability Checklist

My suggestion meets these guidelines:

⭐ Suggestion

This is split off of #25613 after some internal discussion; in --build, most flags are disabled, but it would be convenient to be able to specify --emitDeclarationOnly (true/false).

I'd like to be able to specify --emitDeclarationOnly=false in build mode for the module conversion, which lets us choose whether or not to emit JS or not (for continuous testing of a non-bundled mode); right now I'm using a hack that modifies the config before building and then restores it, which is error-prone when the build is canceled via Ctrl+C.

It's my understanding from our discussion that this flag should be doable, but not without a good bit of changes to what tsbuildinfo and such contain.