-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Specify import_map.json directly in deno.json #15816
Comments
More discussion on this in the closed issue: #12800 |
I read the issue but don't understand why what I am proposing would be a bad idea |
I'm not suggesting it's a bad idea. I'm just saying that there was more discussion on that in the closed issue. |
I wasn't meaning you said it is a bad idea. I rather wanted to say: by reading the issue, I can't figure out what were the reasons they discarded this idea. |
Sorry I misunderstood. The issue was closed because it was moreso the tracking issue for adding just an
|
And this issue is marked as a suggestion, ergo revisiting it. There are a few challenges though:
So we abandoned that part of the proposal to ship something we were 99% sure wouldn't cause problems down the road, and held off doing the things that we might regret, as the improvement gain didn't seem to outweigh the risks. |
I see! Thank you for having taken the time to explain the situation. I am not going to present a satisfying solution as it is breaking but what about prefixing the keywords with the name of the tool. For example: "importMap": "..." for Deno and "ts:importMap": "..." for TS But for consistency some other keywords should be prefixed so this would be breaking. |
We are planning on adding "imports" and "scopes" from import maps to the deno.json/jsonc config file's schema. {
"tasks": {
"build:npm": "deno run -A ./scripts/build_npm.ts"
},
"imports": {
"chalk": "npm:chalk@^1.0",
"cowsay": "npm:chalk@^1.0",
"std/": "https://deno.land/[email protected]/",
}
} In a sense, this would work similar to how html files support embedding import maps. If this is done, the deno.json file is not intended to be used as an import map (it's the deno.json schema adding these keys and not the import map schema). If you wish to do that, then it's recommended to keep the import map file separate as previously done and specify it in a deno config file (ex. |
@dsherret That's seems interesting! I am not sure to understand why with this addition I will still need to use an import map file? |
Sorry, I wasn't clear. This addition doesn't require you to still use an import map file. That's only suggested if you want to share the import map with other tools. |
I see! So that's very great news!!! |
Would it not make more sense to simply "overload" the The main-level EDIT: Overloading the |
Currently, I have to create a deno.json and a import_map.json file. It would be great if import_map.json content could be moved to deno.json. This way I will now have only one remaining config file.
The text was updated successfully, but these errors were encountered: