Importmap
An example of Three.js
index.html
script.js
By providing the attribute type="importmap"
on a script tag, you can define this map and then define a series of bare import names and a relative or absolute URL. Remember that if you are specifying a relative URL such as the example below, the location of that file should be relative to the file where the import-maps
is defined, which is index.html
in this instance:
After defining this map, you can directly import three
anywhere in your code.
Last updated