You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It be possible to reference the bare specifier with deno run:
deno run lume/cli.ts
Instead of:
deno run https://deno.land/x/lume@v1.18.1/cli.ts
Why
Today bare specifiers are interpreted inconsistently by deno run and an import. imports with bare specifiers interpret them using an import map and relative paths must be prefixed with ./. deno run however treats a bare specifier as a relative path.
This prevents developers from conveniently referencing versions in an import map in deno run commands, or in deno tasks. It is easy to accidentally use the wrong version when running a tool with deno run when the project is configured for a different version.
It is possible to work around this by piping an import to the deno run command, but this is not intuitive. For example:
echo "import 'lume/cli.ts'" | deno run -
The text was updated successfully, but these errors were encountered:
dsherret
changed the title
Support deno run resolving bare specifiers with import map
Support deno run resolving bare specifiers with import map and package.json
Oct 7, 2024
dsherret
changed the title
Support deno run resolving bare specifiers with import map and package.json
Support deno run resolving bare specifiers with import map
Oct 7, 2024
Proposal
Support
deno run
resolving bare specifiers with the import map.For example:
If the
deno.json
file contains an import map that mapslume/
tohttps://deno.land/x/lume@v1.18.1/
:It be possible to reference the bare specifier with deno run:
Instead of:
Why
Today bare specifiers are interpreted inconsistently by
deno run
and animport
.import
s with bare specifiers interpret them using an import map and relative paths must be prefixed with./
.deno run
however treats a bare specifier as a relative path.This prevents developers from conveniently referencing versions in an import map in deno run commands, or in deno tasks. It is easy to accidentally use the wrong version when running a tool with deno run when the project is configured for a different version.
It is possible to work around this by piping an import to the deno run command, but this is not intuitive. For example:
The text was updated successfully, but these errors were encountered: