Skip to content

Trouble mixing typescript and javascript files #104

@wgottschalk

Description

@wgottschalk

I'm having trouble getting dependency-tree to follow ts imports from js files. For instance if I define:

// one.ts
import {two} from './two';

export function one() {
  console.log('one');
  two()
}
// two.js
import {three} from './three';

export function two() {
  console.log('two');
  three()
}
// three.ts
import {four} from './four';

export function three() {
  console.log('three');
  four()
}
// four.js
export function four() {
  console.log('four');
}

when I run dependency-tree on the source code:
dependency-tree --directory='.' one.ts

I get the following output:

{
  "one.ts": [
    "two.js"
  ],
  "two.js": []
}

But I'm expecting dependency-tree to be able to resolve the typescript import from a javascript file. Is there any documentation on how to do this? It seems like a common enough case.

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