Skip to content

Instantly share code, notes, and snippets.

@samccone
Created December 18, 2018 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samccone/1fc251093f6e481be72a5b35b359ee1c to your computer and use it in GitHub Desktop.
Save samccone/1fc251093f6e481be72a5b35b359ee1c to your computer and use it in GitHub Desktop.
{
buildEnd() {
const deps = [];
Array.from(this.moduleIds).forEach(v => {
let m = this.getModuleInfo(v);
if (m != null && !m.isExternal) {
for (const source of m.importedIds) {
deps.push({ target: m.id, source})
}
}
});
fs.writeFileSync(path.join(__dirname, 'graph.json'), JSON.stringify(deps, null, 2));
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment