From dc7d22f7aee2fe0ad907a4041402387191ef9e0f Mon Sep 17 00:00:00 2001 From: AiAlchemist0 Date: Wed, 19 Aug 2026 09:58:30 -0700 Subject: [PATCH 1/2] docs: deno pack includes publish.include files (2.9) --- runtime/reference/cli/pack.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/runtime/reference/cli/pack.md b/runtime/reference/cli/pack.md index eb7eb8d80..34797d943 100644 --- a/runtime/reference/cli/pack.md +++ b/runtime/reference/cli/pack.md @@ -1,5 +1,5 @@ --- -last_modified: 2026-05-20 +last_modified: 2026-08-19 title: "deno pack" command: pack openGraphLayout: "/open_graph/cli-commands.jsx" @@ -50,16 +50,27 @@ becomes `-`, matching `npm pack`'s naming convention). | Transpiled `.js` files (with inline source maps by default; pass `--no-source-maps` to omit). | | Generated `.d.ts` declaration files (produced via the same fast-check pipeline as [`deno publish`](/runtime/reference/cli/publish/)). | | `README` and `LICENSE` files from the project root, if present. | +| Non-source files matched by `publish.include` / `publish.exclude` (Deno 2.9+). | -Only files reachable through the module graph from `exports` are included. -Non-JS assets such as data files or WASM are only included if they're imported -from JS/TS. If you need to ship arbitrary files, list them as positional -arguments: +JavaScript and TypeScript still come from the module graph starting at +`exports`. Those files are transpiled; they are not packed as raw `.ts`. + +:::info Deno 2.9 +`deno pack` also copies non-source files that match the same +`publish.include` / `publish.exclude` globs as +[`deno publish`](/runtime/reference/cli/publish/). SVG, WASM, and other assets +listed there go into the tarball as-is. See +[`publish` in deno.json](/runtime/reference/deno_json/). +::: + +You can still pass extra files as positional arguments: ```sh deno pack assets/icon.svg locales/*.json ``` +`--ignore` on the command line applies to these assets as well. + ## Specifier rewriting For the generated package to work on Node and other npm consumers, `deno pack` From 5e417855b4b77d814fc720e3117a7c10ec9b0044 Mon Sep 17 00:00:00 2001 From: AiAlchemist0 Date: Wed, 19 Aug 2026 10:06:21 -0700 Subject: [PATCH 2/2] docs: format pack publish.include note for deno fmt --- runtime/reference/cli/pack.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/reference/cli/pack.md b/runtime/reference/cli/pack.md index 34797d943..5e62c83c3 100644 --- a/runtime/reference/cli/pack.md +++ b/runtime/reference/cli/pack.md @@ -55,13 +55,11 @@ becomes `-`, matching `npm pack`'s naming convention). JavaScript and TypeScript still come from the module graph starting at `exports`. Those files are transpiled; they are not packed as raw `.ts`. -:::info Deno 2.9 -`deno pack` also copies non-source files that match the same +(Deno 2.9+) `deno pack` also copies non-source files that match the same `publish.include` / `publish.exclude` globs as [`deno publish`](/runtime/reference/cli/publish/). SVG, WASM, and other assets listed there go into the tarball as-is. See [`publish` in deno.json](/runtime/reference/deno_json/). -::: You can still pass extra files as positional arguments: