- Rollup Plugin Name: @rollup/plugin-typescript
- Rollup Plugin Version: 12.1.4
Feature Use Case
When using @rollup/plugin-typescript with custom TypeScript transformers in watch mode, there is no way for the transformer to access the latest ts.Program after an incremental rebuild currently.
This leads to issues in incremental builds where the transformer needs to query symbols, types from the current TypeChecker.
Feature Proposal
It is possible to add a second parameter getProgram to the factory function to get the latest Program.
interface ProgramTransformerFactory<T extends TransformerStage> {
type: 'program';
factory(program: Program, getProgram?: () => Program): StagedTransformerFactory<T>;
}