File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ tags: [workspace]
55Ensure that all dependencies are declared in either ` deno.json ` or
66` package.json ` .
77
8+ This promotes better dependency management and makes it easier to track and
9+ update dependencies. It also helps Deno purge the lockfile when removing a
10+ dependency.
11+
812### Invalid:
913
1014``` ts
@@ -16,6 +20,15 @@ import foo from "npm:preact@10";
1620### Valid:
1721
1822``` ts
19- // Mapped in `deno.json` or `package.json`
2023import foo from " @std/path" ;
2124```
25+
26+ With a corresponding entry in the ` deno.json ` or ` package.json ` file:
27+
28+ ``` jsonc title="deno.json"
29+ {
30+ " imports" : {
31+ " @std/path" : " jsr:@std/path@1"
32+ }
33+ }
34+ ```
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ restore them from cache instead of re-downloading.
172172To demonstrate, let's say you have a project that uses the logger from
173173[`@std/log`](https://jsr.io/@std/log) :
174174
175- ` ` ` json, title="deno.json"
175+ ` ` ` json title="deno.json"
176176{
177177 "imports": {
178178 "@std/log": "jsr:@std/log@0.224.5"
You can’t perform that action at this time.
0 commit comments