build-system: Support custom config overlay#27977
Merged
mdmower merged 4 commits intoampproject:masterfrom Apr 25, 2020
Merged
Conversation
Provide a mechanism for overlaying the AMP_CONFIG applied to built scripts. If `build-system/global-configs/custom-config.json` exists and is valid JSON, overlay the active config JSON before applying.
Contributor
Author
|
This PR is inspired by @jridgewell's comment in PR #27100:
|
rcebulko
reviewed
Apr 23, 2020
Contributor
rcebulko
left a comment
There was a problem hiding this comment.
LGTM but leaving un-approved to ensure one of @rsimha or @jridgewell get their eyes on it
rsimha
approved these changes
Apr 24, 2020
Contributor
Author
|
Thanks for the reviews! |
jridgewell
approved these changes
Apr 24, 2020
rsimha
approved these changes
Apr 24, 2020
ldoroshe
pushed a commit
to ldoroshe/amphtml
that referenced
this pull request
May 8, 2020
* build-system: Support custom config overlay
Provide a mechanism for overlaying AMP_CONFIG at build time.
If build-system/global-configs/custom-config.json exists and is valid JSON, overlay the active config JSON before applying it to the target script. This feature would allow anyone building AMP to tweak the applied config without modifying checked-in source. For example, build-system/global-configs/custom-config.json could contain
{
"cdnUrl": "https://example.com/amp",
"geoApiUrl": "https://example.com/geo"
}
and these properties would be added to AMP_CONFIG at build time.
* Update readme
* Revisions from review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide a mechanism for overlaying
AMP_CONFIGat build time.If
build-system/global-configs/custom-config.jsonexists and is valid JSON, overlay the active config JSON before applying it to the target script. This feature would allow anyone building AMP to tweak the applied config without modifying checked-in source. For example,build-system/global-configs/custom-config.jsoncould containand these properties would be added to
AMP_CONFIGat build time.This feature would be documented in the hosting guide (PR #27100).