-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
docs(custom-esbuild): align the HTML transformer signature #1705
base: master
Are you sure you want to change the base?
Conversation
Not sure if it actually closes #1690 - it does align the docs with actual implementation but from what I read there is a request for adding |
We can align the docs for now and then I’ll think on implementing options as a feature. |
Sure thing, just saying that aligning the docs won't close #1690 🙂 |
However, how do we include target options as the first parameter when the HTML transformer is called by Angular with only the HTML content? We are not responsible for its invocation with only a single parameter. // angular-cli
return indexHtmlTransformer && content ? await indexHtmlTransformer(content) : content; We can certainly make adjustments on our end, but I'm hesitant to modify the contract exposed by their API. If they didn't include target options for this builder, there might be a specific reason for it. The target options only include In this builder, the target is typically always set to Which means the only property may be used is the I can talk to one of the Angular CLI team members who worked on the application builder to understand the exact reasons for its removal. I'm not sure if they gonna decide to bring it back. |
@arturovt I'm not sure if this is ideal, but from what I've seen, at the post-bundle time, if there is an index transformation function specified, then this function is called with the index content as a parameter. Considering that the context is available in buildCustomEsbuildApplication (or in executeCustomDevServerBuilder), wouldn't it be acceptable to wrap this in a custom function? For instance, if we take the current code of this file, we would replace line 30 with something like this: Not sure, but it seems to be a similar approach with custom-webpack (source code). |
Closes #1690