1

我正在使用 angular 6 并预加载所有组件,我有 8 个组件:ScreensComponent, AccountComponent, DashboardComponent, FinderComponent, ListerComponent, MonitorComponent, AuthComponent,LoginComponent

但输出是 11 个文件(不包括 main.js 和其他文件)。

我无法理解为什么有 11 个块并且它们的名称很奇怪。此外,大多数文件都非常庞大,我似乎无法理解为什么所有文件都那么重

chunk {8} account-account-module-ngfactory.3381d22a1e8d5db6b823.js (account-account-module-ngfactory) 70.3 kB  [rendered]
chunk {scripts} scripts.29cb0c319e11420627c6.js (scripts) 876 kB  [rendered]
chunk {0} common.e58351c45cec4bb0f84d.js (common) 17.5 kB  [rendered]
chunk {1} account-account-module-ngfactory~finder-finder-module-ngfactory~lister-lister-module-ngfactory.9fd06129611a0271f9ea.js (account-account-module-ngfactory~finder-finder-module-ngfactory~lister-lister-module-ngfactory) 26 kB  [rendered]
chunk {2} finder-finder-module-ngfactory~lister-lister-module-ngfactory~screens-screens-module-ngfactory.d512470383c55e2004b8.js (finder-finder-module-ngfactory~lister-lister-module-ngfactory~screens-screens-module-ngfactory) 68.2 kB  [rendered]
chunk {3} lister-lister-module-ngfactory~monitor-monitor-module-ngfactory.00e81bc0649f067026a6.js (lister-lister-module-ngfactory~monitor-monitor-module-ngfactory) 228 kB  [rendered]
chunk {4} monitor-monitor-module-ngfactory.145e0aaf56cca28ab92d.js (monitor-monitor-module-ngfactory) 238 kB  [rendered]
chunk {5} lister-lister-module-ngfactory.00baef5ecda629c1924b.js (lister-lister-module-ngfactory) 1.03 MB  [rendered]
chunk {6} finder-finder-module-ngfactory.0c67cb70a42e4e1248fd.js (finder-finder-module-ngfactory) 234 kB  [rendered]
chunk {7} dashboard-dashboard-module-ngfactory.0a194d0dd1e6b3d22216.js (dashboard-dashboard-module-ngfactory) 1.49 kB  [rendered]
chunk {9} login-login-module-ngfactory.3803a9fde37726d2fcb1.js (login-login-module-ngfactory) 97.3 kB  [rendered]
chunk {10} screens-screens-module-ngfactory.517275ed05ee9a3474b9.js (screens-screens-module-ngfactory) 200 kB  [rendered]
chunk {11} auth-auth-module-ngfactory.9b8c7640150610ba12dc.js (auth-auth-module-ngfactory) 62 kB  [rendered]
chunk {12} runtime.b75eb3e8646a750ee46a.js (runtime) 2.68 kB [entry] [rendered]
chunk {13} styles.80497f4105b47590510a.css (styles) 80.6 kB [initial] [rendered]
chunk {14} polyfills.c428b26f0c9cd88ad9e2.js (polyfills) 64.3 kB [initial] [rendered]
chunk {15} main.bfa19806e0940a6dbd7e.js (main) 1.06 MB [initial] [rendered]
4

2 回答 2

0

它是 webpack 编译器,它创建这些文件 bij 将所有文件和 node_modules 分块成一些缩小的 javascript 文件。

于 2018-06-19T18:37:36.040 回答
0

这些文件不是用于生产,而是用于开发和调试。如果您使用构建,ng build --prod您将获得要部署的实际文件。

于 2018-08-18T14:29:51.583 回答