JadJ
Denoβ€’10mo agoβ€’
10 replies
Jad

deno.json glob exports

I am using a monorepo with multiple projects.
I would like to use specific files from package @namespace/toolbox in package @namespace/project.

In package toolbox, I have the following deno.jsonc:
{
  "name": "@namespace/toolbox",
  "version": "0.1.0",
  "description": "A collection of tools for our projects",
  "exports": {
    ".": "./mod.ts",
    "./vendor/*": "./vendor/*",
  }
}

In project project, I can do:
import { thing } from '@namespace/toolbox'

No problem.
but I am unable to do:

import { thing } from '@namespace/toolbox/vendor/thing.ts'


I can make it work with the following jsonc:
{
  // ...
  "exports": {
    ".": "./mod.ts",
    "./vendor/thing.ts": "./vendor/thing.ts",
  }
}

But this is a project with many files, and I would rather not list them individually.

What am I doing wrong?

PS: I wasn't sure which tag matches better with my question; I didn't find "publishing". There's an "npm publishing" tag, but that doesn't fit my case, I am not publishing any of these packages, they're only for internal usage
Was this page helpful?