具有最少文件数的 Angular ng 构建? (仅支持 Chrome 也可以)

标签 angular angular-cli angular8

当我构建我的 angular 项目时,我看到
main-es5.jsmain-es2015.js两个文件。我只想支持 Chrome 浏览器如何关闭构建旧的 js 文件我希望 Build.js 上的文件数量最少。

自从我升级到 8 以来,我的 Build 也运行了两次

笔记

Build time has significantly increased and i get the warning WARNING in budgets, maximum exceeded for initial.



这是我的 Angular.json 文件
      "optimization": true,
      "outputHashing": "none",
      "sourceMap": true,
      "extractCss": false,
      "namedChunks": false,
      "showCircularDependencies": false,
      "aot": true,
      "extractLicenses": false,
      "statsJson": false,
      "progress": true,
      "vendorChunk": false,
      "buildOptimizer": true,

浏览器列表文件
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
#   npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

编辑 :在 Github 上提出功能请求

最佳答案

根据 @clydinGitHub 的评论

**browserlist** 
last 2 Chrome versions

https://browserl.ist/?q=last+2+Chrome+versions

创建一个最小的仅 chrome 的 ES2015+ 构建

关于具有最少文件数的 Angular ng 构建? (仅支持 Chrome 也可以),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56464376/

相关文章:

angular - 没有ManagedZone的提供者

Angular 拦截器 - rxjs/map 响应字段

javascript - 以 Angular 2 动态更改标题字符串

angular - 如何配置 systemjs 以识别特定于环境的应用程序路径?

typescript - 为什么 angular-cli 会生成 ngOnInit 而无需为函数结果键入内容?

angular - 在 Angular 8 : : ASSERTION ERROR: NgModule 'MyReportsGridComponent' is not a subtype of 'NgModuleType' 中实现延迟加载时出错

java - 递归 JSON 输入导致 SyntaxError : Unexpected end of JSON input at JSON. 解析

angular - 如何获取使用 ngfor 循环创建的 html 元素

angular - 原理图输入未针对架构 : {"name" :"testng7"} on Angular 7 进行验证

angular - 翻译服务在加载页面上不起作用