为什么延迟加载角度模块会创建额外的块 default~customer-customer-module~order-order-module?

Job*_*med 6 angular

我的应用程序包含5个模块- ,CoreModule,,和。,并且是延迟加载的模块。SharedModuleUserModuleCustomerModuleOrderModuleUserModuleCustomerModuleOrderModule

当我ng server的应用程序,它应该产生3块- user-user-modulecustomer-customer-moduleorder-order-module

但它正在default~customer-customer-module~order-order-module与这三个块一起创建另一个额外的块。

现在在本地主机中运行应用程序,打开开发者工具的网络选项卡:

  1. 导航到UserModuleuser-user-module.js已加载。
  2. 导航到CustomerModuledefault~customer-customer-module~order-order-module.jscustomer-customer-module.js加载。

我的查询是:

  1. 为什么 Angular CLI 会创建额外的块default~customer-customer-module~order-order-module
  2. 导航到 时UserModule,仅user-user-module.js加载。但是,为什么default~customer-customer-module~order-order-module.jscustomer-customer-module.js被加载时浏览到CustomerModule

我需要知道可能是什么原因。我无法分享我的源代码。请给出你有意见的答案。

角版本: 7.3.9。

c_o*_*goo 6

这是 webpack 的一个特性,称为split-chunks

它生成了一个共享的依赖包,在您的客户模块和订单模块中使用。