...
https://gis.stackexchange.com/questions/246253/refreshing-web-appbuilder-widget-during-development
Publishing
First, you cannot publish custom widgets back to the WAB built into Enterprise/Portal, as per this: https://community.esri.com/thread/121410
You can publish apps which use custom widgets and themes by following these steps: