角束(AoT编译)中生成的各种文件的作用是什么 [英] What are the roles of various files produced in angular bundle (AoT compilation)

查看:65
本文介绍了角束(AoT编译)中生成的各种文件的作用是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在当前的angular4项目中运行了 ng build --prod --aot ,并且在dist文件夹中找到了以下文件.

I ran ng build --prod --aot in my current angular4 project and I got following files in my dist folders.

  1. inline.6405cab307cfc3c6a636.bundle.js:2 KB
  2. main.a799c9fd4322567743dc.bundle.js:35 KB
  3. polyfills.b72d4efc376613f94934.bundle.js:63 KB
  4. scripts.6072021e6a4e32c07d7e.bundle.js: 963 KB
  5. styles.737751caddf6a44d0993.bundle.css:146 KB
  6. vendor.c85bb23c3f86ba86be80.bundle.js:548 KB
  7. 0.01d7070ba0efe736c78d.chunk.js:129 KB
  1. inline.6405cab307cfc3c6a636.bundle.js : 2 KB
  2. main.a799c9fd4322567743dc.bundle.js : 35 KB
  3. polyfills.b72d4efc376613f94934.bundle.js:63 KB
  4. scripts.6072021e6a4e32c07d7e.bundle.js:963 KB
  5. styles.737751caddf6a44d0993.bundle.css:146 KB
  6. vendor.c85bb23c3f86ba86be80.bundle.js:548 KB
  7. 0.01d7070ba0efe736c78d.chunk.js: 129 KB

我想知道:

  1. 这些文件中的每一个都包含什么样的代码.我想知道这一点,因为我希望能够控制每个文件的大小.
  2. 在浏览器中加载页面需要这些文件中的哪些文件.
  3. 关于 scripts.6072021e6a4e32c07d7e.bundle.js :我创建了一个新的ng4项目并对其进行了编译.dist中没有这样的文件.但是,此文件是在我当前项目的编译过程中产生的(并且权重最大).你能回答为什么吗?
  1. What kind of code goes in each of these files. I want to know this because I want to be able to control the size of each file.
  2. Which of these files are necessary for page load in the browser.
  3. About scripts.6072021e6a4e32c07d7e.bundle.js : I created a new ng4 project and compiled that. There was no such files in the dist. However this file is produced during compilation of my current project (and weights the heaviest). Can you answer why?

推荐答案

1) scripts.abc.bundle.js :从 scripts 数组中生成> .angular-cli.json 文件 https://github.com/angular/angular-cli/wiki/stories-global-scripts

1) scripts.abc.bundle.js: generated from the scripts array inside your .angular-cli.json file https://github.com/angular/angular-cli/wiki/stories-global-scripts

styles.abc.bundle.css :由 .angular-cli.json 文件

vendor.abc.bundle.js :从 node_modules

polyfills.abc.bundle.js :是为了与旧版浏览器兼容(例如IE 9)而生成的

polyfills.abc.bundle.js: generated for older browser compatibility (like IE 9)

main.abc.bundle.js :您的主要组件代码

inline.abc.bundle.js :用于Webpack导入.

inline.abc.bundle.js: for webpack imports.

chunk.js :用于.png文件之类的块片段.

chunk.js: for chunk fragments like .png files.

2)全部

3)由于在新项目中scripts数组将为空,因此不会生成任何包.

3) Since in a new project the scripts array will be empty, there won't be any bundle to generate.

这篇关于角束(AoT编译)中生成的各种文件的作用是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆