madge icon indicating copy to clipboard operation
madge copied to clipboard

support for module-alias

Open unknownuser88 opened this issue 6 years ago • 6 comments

Hello! is it possible add support for module module-alias ?? if I use this module, the svg image shows everything on the same level

unknownuser88 avatar Apr 16 '18 08:04 unknownuser88

+1 for https://www.npmjs.com/package/babel-plugin-module-resolver

gregorskii avatar Oct 03 '18 21:10 gregorskii

Look like madge can't handle webpack aliases as well. I know it has an option, like:

{
    "webpackConfig": "./config/webpack.config.js"
}

However, that doesn't work when I run madge from a webpack loader (I know, running madge from a loader is a very special case)

It neither works adding this to package.json

  "madge": {
    "webpackConfig": "./config/webpack.config.js"
  }

gperez-10pines avatar Oct 19 '20 18:10 gperez-10pines

@gperez-10pines i had the same issues. The reason was that I am using typescript too. so you need to specify both tsconfig.json and wepack.config.js in your madge config as follows:

{
      "tsConfig": "tsconfig.json",
      "webpackConfig": "webpack.config.ts",
      "fileExtensions": [
        "js",
        "jsx",
        "ts",
        "tsx",
        "json"
      ]
}

3kumar avatar Mar 14 '21 18:03 3kumar

Cant seem to get this working... im using the CLI directly but it doesnt want to resolve any of my aliases. Everything else works fine, but i get like 2300 warnings and looking at the output for those skipped files, they are all aliased paths. Using debug i can see its resolving my tsconfig, and I have aliases set in both tsconfig and webpack config and and passing those to madge. Not sure what the deal is. :(

This is a dope project other than that.

gunn4r avatar Jun 25 '21 01:06 gunn4r

Is there any update on this feature? I assume this is a showstopper for lots of modern developers?

mlostekk avatar Feb 08 '22 08:02 mlostekk

Works for me (running it on cli) with module-alias if I specify --ts-config ./tsconfig.json

metal450 avatar Apr 08 '22 23:04 metal450