Yes as @donmccurdy has suggested you could go through all the files you need and change all import references from ‘three’…
`import * as THREE from ‘three’
to ‘…/…/…/build/three.module.js’;
import * as THREE from '../../../build/three.module.js'
Yes as @donmccurdy has suggested you could go through all the files you need and change all import references from ‘three’…
`import * as THREE from ‘three’
to ‘…/…/…/build/three.module.js’;
import * as THREE from '../../../build/three.module.js'
Yes, I figured. I am hoping it would be possible to script this. If so, I just need to run it a serverless function to get the latest build whenever with a fall back to a recent version.
Demoduler is provided pretty much AS IS, so check its repository and see the disclaimer at the bottom.
There is just no guarantee that all converted files will work properly.
I doubt that anyone would complain if you modify it to your liking, while observing its license of course.
Thanks, will check the source. I am in the assumption that it would be something that can be automated. I could be super wrong here!
I don’t think you can inject an importmap without generating a warning/error that the importmap must be declared before other scripts are loaded.
No complains from me (I’m the author of the Demoduler). I made it some time ago as a temporary tool. That’s why I did not spent too much efforts on it. I have never imagined that it could be still used. It has outlived all my expectations.
The possibility for automatic conversions would be a nice extension, although I’m not sure how many users will use it. As I usually needed to convert 5-10 files at most, it was no problem to me just to drag them to the Demoduler (once a month) and then download them.
In the past I had an idea to process each new Three.js release and to store/host already converted files, so that people just take the converted files, instead of convert them by themselves. But had never had the urge to implement this.