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

feat: Expand 'imports' section of deno.json #22087

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Jan 24, 2024

This commit adds automatic expansion of "imports" field in "deno.json" file.

If "npm:" or "jsr:" imports are encountered we automatically try to add a "directory"
remapping.

Previously users had to specify entries for both foo and foo/ to be able to import like
import { symbol1 } from "foo"; and import { symbol2 } from "foo/some_file.js":

{
  "imports": {
    "foo": "npm:@foo/bar",
    "foo/": "npm:/@foo/bar/",
}

With this change users can only add entry for foo:

{
  "imports": {
    "foo": "npm:@foo/bar",
}

The entry for foo/ will be provided automatically.

Similarly if user provides "directory" remapping explicitly, we will not overwrite it.

@bartlomieju bartlomieju added this to the 1.40 milestone Jan 24, 2024
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

Successfully merging this pull request may close these issues.

3 participants