plugins icon indicating copy to clipboard operation
plugins copied to clipboard

Typescript plugin transformers API design is incompatible with angular compiler

Open Haringat opened this issue 1 year ago • 3 comments
trafficstars

  • Rollup Plugin Name: typescript
  • Rollup Plugin Version: 11.1.6

Expected Behavior / Situation

I would like to use the NgTscPlugin from @angular/compiler-cli to create transformers for @rollup/plugin-typescript. NgTscPlugin#createTransformers seems to have exactly the return type that the rollup plugin can use.

Actual Behavior / Situation

In order to call createTransformers, I have to have called setupCompilation, which needs a program, which is only available inside the factory method of a program transformer. So I would need to be inside a transformer to create the transformers.

Modification Proposal

If possible, it would be nice to have the transformers configuration option be a callback that is provided with a program (and maybe even a compilerhost?) and returns the transformers object.

Haringat avatar Jan 22 '24 13:01 Haringat

Thanks for the issue. This isn't likely to see any traction unless there's a contribution from the community. Mostly because, well Angular, but also bc this is an Angular specific problem whereas we don't have the issue with the majority of frameworks (otherwise we'd have a flood of issues about it)

shellscape avatar Jan 22 '24 13:01 shellscape

Did this get fixed? I also need it for an angular project.

Mr-Jami avatar Jul 08 '24 17:07 Mr-Jami

@Mr-Jami please brush up on how to read issues and associated pull requests. the linked PR has not been merged.

shellscape avatar Jul 08 '24 18:07 shellscape