moon
moon copied to clipboard
[feature] Support YAML references (anchors/aliases) in config files
Is your feature request related to a problem? Please describe.
Nope
Describe the solution you'd like
YAML supports reusing values within a document through features known as anchors and aliases. It looks something like the following:
tasks:
build: &webpack_shared
command: webpack
args: build
inputs:
- 'src/**/*'
start:
<<: *webpack_shared
args: start
It would be nice if our config files supported this syntax.
Describe alternatives you've considered
Additional context
Work has started here https://github.com/moonrepo/moon/tree/05-yaml-ref but seems to be blocked by serde_yaml: https://github.com/dtolnay/serde-yaml/issues/245
+1 would help to keep the yml config files DRY and make them easier to manage/ changing values
Will be in the next version.
@milesj - happy to see this works :) Would be great to include some info and an example in the docs