Skip to content

./assets in the exclude field of typst.toml actually matches **/assets #3617

Description

@YDX-2147483647

Description

- `exclude`: An array of globs specifying files that should not be part of the

It looks like an array of globs is the only description for the format of the exclude field in typst.toml.
This ambiguity cause problems.

QuadnucYard/ourchat-typ#3 is an example.
This package has the following file structure.

  • /typst.toml
  • /assets/ (to be excluded)
  • /src/
    • /src/assets/ (to be included)

The package specifies ./assets, but surprisingly, it matches both /assets/ and /src/assets/.

exclude = ["./assets"]

Analysis

The bundler trims the ./ prefix, and uses a library for .gitignore to parse the glob.
As a result, ./assets becomes assets, and matches recursively.

let exclusion = exclusion.trim_start_matches("./");

(introduced in b41d483)

Workaround

Use /assets.
(not confirmed yet)

Confirmed with https://github.com/typst-community/dev-builds/releases/tag/packages-bundler-main.2025-12-10.8c2f3eb.

Links

Discord

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions