cypkeC
Deno14mo ago
cypke

imports or deps.ts

Hi! I'm trying to create my first Deno app. I'm trying to dockerize it and the Dockerfile has this line:
# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno install --entrypoint deps.ts


But all my imports are in deno.json
{
  "tasks": {
    "dev": "docker build -t app . && docker run -it -p 1993:1993 app"
  },
  "imports": {
    "@std/assert": "jsr:@std/assert@^1.0.7"
  }
}


So I was wondering, is deps.ts an old way of importing things? Which one is the preferred way?
Was this page helpful?