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:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
⭐ 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.