There's no way to require it. The best you can do is tell the user to do it.
Also, it use require.main.require instead
Hi guys, what will you recommend for the plugin, that should be implemented with a widget, but should use client JS that is hosted on CDN?
Asynchronous loading of the js file (script injection)?
@julian yes. For example Google with their Chromecast, asks for using link from CDN, etc.
Yeah, I'd probably have the widget load js if the library it wants to use isn't found...
var scriptEl = document.createElement('script');
scriptEl.src = 'http://...';
scriptEl.type = 'text/javascript';
// then do some magic to append it to <head>
@julian What do you think about an idea to extend .json
configuration for plugins, to have something related to external scripts (scripts.external = []
)?
Also will minifier use external js? So every reboot of forum will give latest version to the user.