如何在产品构建中找出哈希文件和模块之间的依赖关系?

How to find out dependencies between hash files and modules in the product build?

我有一个大型 angular 6 项目,其中 modules.

当我得到 prod build 时,一些 hash files 的大小非常大(例如:2.7 Mb 或更多)。

如何找出生成的hash file属于哪个模块?

例如:

1.14740d297f4ae812ec17.js ===> people.module.ts

2.16ab3d967be5798968ad.js ===> foo.module.ts

可能吗?

谢谢。

也许 source-map-explorer 可以帮助您。它分析随包生成的源映射并绘制所有依赖项的映射,准确显示包中包含哪些 类。

只需添加

--namedChunks

添加到您的构建语法中。 类似 :

ng build --base-href /ProjectName/ --prod --build-optimizer --vendor-chunk --namedChunks

Angular 自动将块重命名为其模块名称。

此参考可能有所帮助: Angular Build