With D8, the appropriate method for adding fields during install with a custom module is with the config system and
.yml files in a
I have a module for user theming I like to use for new D8 site installs, it adds hooks, templates, fields.
With a minimal install, this module provides the field and storage config for the
user.user.user_picture field, as well as the
entity_view_display for compact and token view modes for the user.
I also include some custom fields such as
Obviously, with a standard install, this module will get the errors that the
user.user.user_picture config already exists among others.
I would really prefer that the config overwrites the display config for the view modes, but would take them just being ignored on install if it already exists.
Is there a method following the Drupal config system to get conditional, or overriding, (synchronized) config during install? Or do I need to use the features module?
Is there a definitive approach for this?