-
Notifications
You must be signed in to change notification settings - Fork 12k
Applying Typescript Transforms Before the @ngtools/webpack Loader #19328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@benwinding, can you please explain what you are trying to achieve and what are the problem you are facing when using TypeScript transformers? |
Hi @alan-agius4, This transformer would convert my own type of decorators and generate angular decorators ( Any ideas or suggestions on how to accomplish this goal? Thanks for any help you can offer, |
Hi @benwinding, That is something which is not possible and is not in the roadmap to support. See @alxhub comment in angular/angular#22434 (comment). As Alex highlighted, TypeScript transformers run before emit, hence using a typescript transformer in this case is already too late as the analysis phase would have already been finalized. This above pattern also has the drawback that it breaks |
Hi @alan-agius4, Thanks for the response, I can understand the current limitations.
See I don't believe this is a drawback. The code migrations will still work as existing The generated transformed Anyway, I really want to alter the Angular build process, rather than abstracting around the entire process, but it seems this is not possible yet... anyway I appreciate your quick responses and help with the matter. Cheers, |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Goal
So I'm trying to apply a typescript transform to angular files BEFORE the webpack plugin
AngularCompilerPlugin
touches them.Problems
@ngtools/webpack
ignores all previous loaders (The @ngtools/webpack loader does not fully support loader chaining) as mentioned in this commentAngularCompilerPlugin
directly touches the filesystem instead of using webpack's virtual filesystem as explained in this commentPossible Solution
AngularCompilerPlugin
's private api_transformers
or_platformTransformers
, but adding a transformer doesn't seem to transform the typescript BEFORE theAngularCompilerPlugin
processes the typescript.Does anyone have any suggestions? Is this even possible?
Lastly big thanks to all the contributors! 👍
Related Issues
The text was updated successfully, but these errors were encountered: