pahen / madge

Create graphs from your CommonJS, AMD or ES6 module dependencies
MIT License
9.08k stars 317 forks source link

[BUG] export * from 'xx' is in leaves result #369

Open zhuqingyv opened 1 year ago

zhuqingyv commented 1 year ago
// a.js
export const a = {}
// b.js
export const b = {}
// index.js
export * from 'a';
export * from 'b';
// madge.js
const madge = require('madge');
madge('index.js', {
      baseDir: './',
      fileExtensions: ['js', 'ts', 'tsx', 'jsx'],
      excludeRegExp: ['website', '.png', '.jpg'],
      // tsConfig: path.resolve(__dirname, './tsconfig.json')
    }).then((res) => {
      const list = res.leaves();
      fs.writeFileSync(path.resolve(__dirname, './result.json'), JSON.stringify(list, null, 2));
    });

output

[
  "a.js",
  "b.js",
]
imakan commented 1 year ago

any answer?