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

Way to read the import map for the current environment at runtime #258

Closed
jaydenseric opened this issue Sep 9, 2021 · 1 comment
Closed

Comments

@jaydenseric
Copy link

Is there a standard way to read what the import map is for the current environment at runtime? If not, it would be useful to specify one; perhaps via a new standard global or import.meta property.

Use case: An import map can be specified via a Deno CLI arg (e.g. --import-map=importMapProd.json) when starting an application server. When the Deno application serves SSR HTML for a route, it would be good to be able to extract the import map from the current JS environment and JSON.stringify it to establish the type="importmap" script in the HTML for the browser to use. This way the server and client can easily use exactly the same import map, without having to come up with configuration or environment variables that would complicate the simplicity of specifying the import map as a Deno CLI arg.

@domenic
Copy link
Collaborator

domenic commented Sep 9, 2021

Dupe of #128 ?

@domenic domenic closed this as completed Oct 14, 2021
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