I want to print a Javascript dependency graph using madge. It prints all dependencies of a given file successfully. Unfortunately, it skips the imported .ts
files and subsequently does not show them in the graph.
Here is my config (.madgerc
):
{
"fileExtensions": ["js", "ts"],
"tsConfig": "./tsconfig.json",
"graphVizOptions": {
"G": {
"splines": "ortho"
}
}
}
Here is my tsconfig.json
:
{
"compilerOptions": {
"esModuleInterop": true,
"allowJs": true,
"preserveConstEnums": true,
"module": "commonjs",
"target": "ES2018",
"moduleResolution": "node",
"noEmit": true,
"rootDir": "../"
}
}
I run madge like so:
madge src/main/path/to/file/view-model.js --warning --debug -i ~/Desktop/graph/view-model.png
It prints:
✔ Image created at /Users/patrick/Desktop/graph/view-model.png
✖ Skipped 1 file
./transform-sponsor
transform-sponsor
is imported in my Javascript file like so:
const {transformSponsors} = require('./transform-sponsor');
So my question is, why does madge skip my typescript file. Even though I specifically added a tsconfig
file as explained in the documentation?