Learn how to store asset selectors for easy access and readability.
YAML selectors allow you to define and manage complex asset selection criteria in a single
selectors.yml file. Storing selectors improves code readability by allowing the reuse of complex asset selection statements across your Y42 space. Moreover, selectors are version-controlled using your space's Git repository, ensuring they remain synchronized with your build history.
In Code Editor mode, create a new
selectors.yml file in the project's root directory. This file must be place at the top-level of your Y42 project, alongside
Define your selectors in the
selectors.yml file with the following properties:
- (required) - Write all asset selection logic within this YAML key.
Once you've committed the
selectors.yml file to the space's Git repository, you can apply a selector using the
--selector command flag.