...the import map means that importing "mymodule" will load the path "./mymodule-v1.js".
Why to use import maps
You don't have to use import maps, but they can be a handy way to organize your imports. To illustrate this, using the example above, suppose you import "mymodule" in lots of places. You can then change that from importing "./mymodule-v1.js" to importing "./mymodule-v2.js" merely by changing the entry in the import map - you don't have to go through every place it's imported and update it. So import maps can help manage complex sets of imports more easily.
Some third-party libraries like three.js also rely on import maps, and so supporting them makes it easier to use these libraries. You can find an example of this in the Integrated 3D engine example.
Limitations
As of September 2024, browsers don't support using import maps in web workers. Therefore if you use import maps, your project will run in DOM mode and not be able to use worker mode.
Currently Construct only supports the "imports"
field in an import map. The "scopes"
and "integrity"
fields are supported by browsers, but are not yet supported in exported projects, as these need special handling for cases like minified exports.