pahen/madge — pull request #35 by warpdesign (2014-09-04 09:24:20+00:00)
Title: IMPROVED: correctly detect circular dependencies when using path aliases

If you have these two files:

js/x86.js:
define(['cpu'], function(cpu) { });

js/dos.js:
define(['jsdos'], function(dos) { });

and a requirejs config that defines the aliases:

requirejs.config({
paths: [
jsdos: 'js/dos',
cpu: 'js/x86'
]});

madge would not detect any dependencies and would list the following dependencies:

js/x86
jsdos
js/dos
cpu

and say "No circular dependencies found!" when run with -c option although js/dos and js/x86 have circular dependencies.

This pull request fixes the problem by replacing aliases with file names.

Note: requires --requirejs-config option