dnt
dnt copied to clipboard
Fails to traverse directories in importMap
This is a bit hard to understand without seeing the actual directory structure, so I've put a reproduction together here:
https://github.com/dylanpyle/dnt-repro
dnt
fails to traverse directories/identify the correct base directory across folders specified in a deno.json
import map, if the import used is more than one directory deep.
So, if your deno.json
contains:
{
"imports": {
"project-two/": "../project-two/"
}
}
— and you import something e.g.
import { thing } from "project-two/one-more-folder/mod.ts";
— it fails with the following error:
[dnt] Transforming...
error: Uncaught (in promise) "Error stripping prefix of /Users/dylan/dev/scratchpad/dnt-repro/project-two/one-more-folder/mod.ts with base /Users/dylan/dev/scratchpad/dnt-repro/project-one"
Reproduction steps:
- Clone the sample repo @ https://github.com/dylanpyle/dnt-repro
-
cd project-one
-
deno run -A compile.ts
Expected output:
- It works (which it does without the extra nested directory, and in most other similar cases)
Actual output:
$ deno run -A compile.ts
[dnt] Transforming...
error: Uncaught (in promise) "Error stripping prefix of /Users/dylan/dev/scratchpad/dnt-repro/project-two/deeper/mod.ts with base /Users/dylan/dev/scratchpad/dnt-repro/project-one"