Expose postTransform to all builder APIs to allow index html manipulation #26299
Description
Command
build, serve
Description
We are dynamically generating our index.html through just-jeb/angular-builders because we have preconnect's set based on env vars and other stuff that cannot be done through JS.
Now we want to move to the Angular 17 application builders. But we cannot modify the index.html there. We already tried programmatically but buildApplication does not expose the transform plugin option from IndexHtmlGenerator.
Describe the solution you'd like
The IndexHtmlGenerator already has an postTransformPlugin which only requires the option postTransform to be passed to it from the builders.
If we would pass this option to executePostBundleSteps and then to generateIndexHtml we can then modify the index.html.
Describe alternatives you've considered
An angular.json property to a file that exports a default function that is passed to postTransform
Activity
muuvmuuv commentedon Nov 9, 2023
@angular-devkit__build-angular@17.0.0.patch
Here is a patch file that works.
angular-robot commentedon Nov 10, 2023
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
arnabk commentedon Dec 11, 2023
👍
refactor(@angular-devkit/build-angular): add index HTML transformer t…
refactor(@angular-devkit/build-angular): add index HTML transformer t…
refactor(@angular-devkit/build-angular): add index HTML transformer t…
refactor(@angular-devkit/build-angular): add index HTML transformer t…
refactor(@angular-devkit/build-angular): add index HTML transformer t…
angular-automatic-lock-bot commentedon Jan 14, 2024
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.