For up to r158 you could try the demoduler. For releases above r158 it may work if the source code uses the same style. At least until the WebGL-WebGPU split there is some chance to convert the main three.module.js and some of the addons like OrbitControls.js.
Although this might be an easier approach, a better solution is to use a bundler. Here is a story:
I also have a project that relies to be used by students in a protected environment (i.e. they cannot install other software, and they need to be able to work off-line with local files only). A month ago I converted the software to use Three.js modules, then used a bundler (rollup.js) to pack everything in a single file that can be used locally without internet or local web server. And it works beautifully. But I had two months of trial-and-error nightmares until I did the conversion. And I’m still not sure why it works.
Edit:
Spent half an hour trying to convert one of your nice demos into r179. I think I managed to do it. Attached is a ZIP file that contains:
Lens 3D Sim - original.html- this is your original filethree.js- modifiedthree.jsto be without modulesOrbitControls.js- modified OrbitControls to be without modulesLens 3D Sim - external.html- your file that uses these two modified filesLens 3D Sim - embedded.html- your file with embedded modified files
Could you try whether Lens 3D Sim - embedded.html works the way your expect? This should be the single file that works as in the old times.
Lens 3D Sim.zip (1.1 MB)
Here is what it looks like when I start the HTML file from a local folder:
NB. I had to fix the names of few classes, as they have changed, Geometry → BufferGeometry and SphereBufferGeometry → SphereGeometry. All changes are marked by a cat ^..^
