I would recommend checking out some other widgets in the app store to see how they load external libraries:
I have personally loaded external libs in the postCreate method. If you use this approach you need to set the loaded flag so that mendix knows when your widget is ready see https://apidocs.mendix.com/7/client/tutorial-widget-lifecycle.html
Hope this helps
A bit of a late reply as I've been tackling this issue the last few days myself - I found that you can include HTTP/HTTPS libraries through the Dojo AMD loader, but you cannot use them in the Define statement as they get marked as invalid for the cloud.
What you can do is is add them in the require statement, that way you cannot directly reference the js package in your declare statement but you can use any keywords and libraries defined within the js.
Hope this is of some use!
Discovered something interesting (thanks to the reply by Andrej). If i refer directly to the library using the http statement in define, it works locally but not in the cloud. When I download the library and use the reference, it works locally AND in the cloud. Now I'm not sure if this remains functional but lets see how it goes.