mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
![]() Closes https://github.com/denoland/deno/issues/29897. Closes https://github.com/denoland/deno/issues/14066. Closes https://github.com/denoland/deno/issues/19955. With this PR we'll attempt to resolve bare specifiers passed to `run` or `serve` with the workspace resolver. This means you can run specifiers that are defined in your import map/package.json. If the specifier looks like a path (starts with `.`, or is an absolute path) then we won't try to resolve it via the import map. This does have the potential to break someone, in the case that you have something like ``` { "imports": { "foo.ts": "./bar.ts" } } ``` and you have a file named `foo.ts`, previously `deno run foo.ts` would run `./foo.ts`, now we would run `./bar.ts`. I can't see a way around that without doing an extra stat to see if the file exists, or deferring this to module load time (which seems complex). I don't think many people would hit that, and if someone does there's a simple fix – just add `./` to the front. From my benchmarking, this change has no effect on startup time |
||
---|---|---|
.. | ||
src | ||
__test__.jsonc | ||
absolute_unix.out | ||
absolute_windows.out | ||
deno.jsonc | ||
direct_file.out | ||
jsr_specifier.out | ||
local_file.out | ||
npm.out | ||
relative_mapping.out |