Hi,
I am trying to build a smart relay plug and would like to power the Nodemcu, connected to the relay, directly through the 220V ac mains power. Currently I am using a mobile phone charger to do the same. I want to make it smaller to fit inside a box which can be hidden behind the main plugs.
I believe the manufacturers are doing the chargers as cheap, small and safe as possible. I doubt you can do better. If it will be safely hidden, you may remove the plastic housing, cut the cable to solder it directly etc.