Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure a library's import * as lib name in importmap generator? #31

Open
trusktr opened this issue Oct 9, 2023 · 2 comments
Open

Comments

@trusktr
Copy link

trusktr commented Oct 9, 2023

For example, I might like to have a convention where users use import * as Lib or import * 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.

@trusktr
Copy link
Author

trusktr commented Oct 9, 2023

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>

@guybedford guybedford transferred this issue from jspm/project Oct 15, 2023
@guybedford
Copy link
Member

I've transferred this issue into the main generator repo. I'd be open to options here. This may also be related to #32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants