Could you give some example of this? Ideally you wouldn’t be modifying existing code.
There are examples in expo/expo. Check under packages/*/plugin.
expo/expo
packages/*/plugin
Also, in case it helps, my first attempt at config plugins is here