2016-11-28 44 views

回答

0

Dependency cruiser可产生依赖性图:你已经通过它安装npm

npm install --save-dev dependency-cruiser 

你应该首先运行:

node_modules/.bin/depcruise --info 

为了确保,TypeScript支持起作用。

用命令

node_modules/.bin/depcruise --exclude "^node_modules" --output-type json <your_entry_point.ts> > dependencies.json 

您可以创建一个包含您的打字稿文件之间的依赖关系的JSON文件。

如果您已经安装了dot实用程序(在graphviz包大多数Linux发行版可用)也一样,你可以这样做:

node_modules/.bin/depcruise --exclude "^node_modules" --output-type dot <your_entry_point.ts> | dot -T svg > dependency_graph.svg 

生成依赖图作为SVG图像。

+0

虽然此链接可能回答此问题,但最好在此处包含答案的基本部分,并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 - [来自评论](/ review/low-quality-posts/18312553) – DarthJDG

相关问题