Open trusktr opened 9 months ago
As an example, people in Three.js community tend to use THREE
as the namespace when they import (convention from the global script days). So if the import
statement for Three.js could be configured at the library level, the script in the output could be:
<script type="module">
import * as THREE from "three";
// Write main module code here, or as a separate file with a "src" attribute on the module script.
console.log(THREE);
</script>
I've transferred this issue into the main generator repo. I'd be open to options here. This may also be related to https://github.com/jspm/generator.jspm.io/issues/32.
For example, I might like to have a convention where users use
import * as Lib
orimport * as LIB
in all my code examples, and it would be nice if JSPM can perhaps read metadata (I'm guessing from package.json) so it know what name to use by default in the importmap generator's output sample.