-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Default map should be always preferred over import map given by user #164
Comments
I assume a user may want to override the default import map of Lume, so the user provided configuration should replace the default one. Why do you want to define a different import map for Lume, but at the same time, Lume override it? |
It's for LSP. I have to tell my code editor what that Do you think user want to override the lume path? Isn't it the partial monkey patch, which would be done by scope section of the import map? |
Mmm, I see. |
Hmm, I don't think it is very good idea. {
"deno": {
"initialization_options": {
"enable": true,
"lint": true,
"unstable": true,
"importMap": "alternative_import_map.json"
}
}
} This kind of settings are different by LSP provider. I don't think it's possible to have a lot of options to Rather than that, it's nice to have an option for switching this behaviour to override the default or not, like |
Mmm, I understand. Maybe we can have a |
But in that case I have to maintain two different import map. One for LSP, the other for building site. It's against DRY. If deno LSP can read two different import map, your suggestion seems the best. But it's not the case, so... |
How about creating import map inside the _config.ts? Or more simply, import it from |
Mmm, not sure to understand. I mean creating just one import map that can be used by everything. For example, you can have this import map: {
"imports": {
"std/": "https://deno.land/std@0.121.0/"
}
} and after running {
"imports": {
"std/": "https://deno.land/std@0.121.0/",
"lume": "https://deno.land/x/lume@v1.4.3/mod.ts",
"lume/": "https://deno.land/x/lume@v1.4.3/",
"https://deno.land/x/lume/": "https://deno.land/x/lume@v1.4.3/"
}
} So, this file can be used by the LSP, VSCode config, etc. |
Ah, I got what you mean. That Additionally, how about warning if the version of Lume is different from that of specified at import map? Lines 152 to 160 in a6a8a91
|
Yes, good point. |
The latest development version of lume ( |
lume/ci.ts
Line 88 in 89a7954
Shouldn't this be opposite?
{ ...resolvedMap.imports, ...map.imports }
seems better.I spent 2-3 hours resolving the following error, and that was because of mismatch between the import map I specified (lume==1.4.2) and the real Lume version(lume==1.4.3).
I set Lume url on my import map just for LSP.
On the real situation of building the site, the lume version specified through import map is better to be same as the running lume.
The text was updated successfully, but these errors were encountered: