Npm free Threejs

Node is everywhere, for good reason, but you can work without it using a CDN, modules and import maps. I’m using threejs and several other ESM modules like this, as recommended in the manual:

<!-- Import maps polyfill -->
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<script type="importmap">
   {
      "imports": {
         "three":			"https://cdn.jsdelivr.net/npm/three@0.149.0/build/three.module.js",
         "three/addons/":	"https://cdn.jsdelivr.net/npm/three@0.149.0/examples/jsm/",
      }
   }
</script>

Import them like this in your js files:

import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import Stats from "three/addons/libs/stats.module.js"