Importing from cdn

how to import GLTFL loader when using 3js over cdn
this is the code to import it from local files
import { GLTFLoader } from ‘three/addons/loaders/GLTFLoader.js’;

You can use this URL to load it:

You can substitute the version number with whichever version of ThreeJs you’re using.

so in code:

<script src=""></script>

Alternatively, this link should give you the latest version at all times:

If you want to use this exactly string:

Define import map that maps three/addons/

Like in this template (you can use other CDN’s URLs if you like)

<script async src="" crossorigin="anonymous"></script>
<script type="importmap">
    "imports": {
      "three": "",
      "three/addons/": ""