ES6 import use with external link

Is there a way to use a direct link in import tag like:

import * as THREE from ‘’;

If i run the script with this type of import, i get “Access to script at ‘access-control-allow-origin:’ from origin…etc” error

Yes, but not from GitHub. Various other CDNs like jsdelivr and unpkg are available:

1 Like