Measuring is extremely important, without numbers we don’t know about potential problems and we don’t have a base we can improve upon. Performance Budgets are a way to impose limits on metrics that may affect our app’s performance. In this lesson we’ll learn how to configure the Angular CLI to configure performance budgets, to monitor them and to alert us when we violate them.

In angular.json:

  1. "configurations": {
  2. "production": {
  3. "fileReplacements": [
  4. {
  5. "replace": "src/environments/environment.ts",
  6. "with": "src/environments/environment.prod.ts"
  7. }
  8. ],
  9. "optimization": true,
  10. "outputHashing": "all",
  11. "sourceMap": false,
  12. "extractCss": true,
  13. "namedChunks": false,
  14. "aot": true,
  15. "extractLicenses": true,
  16. "vendorChunk": false,
  17. "buildOptimizer": true,
  18. "budgets": [
  19. {
  20. "type": "bundle",
  21. "name": "main",
  22. "maximumWarning": "350kb",
  23. "maximumError": "500kb"
  24. }
  25. ]
  26. }
  27. }
  28. },

[Angular 8] Calculate and Measure Performance budgets with the Angular CLI的更多相关文章

  1. Angular 1 深度解析:脏数据检查与 angular 性能优化

    TL;DR 脏检查是一种模型到视图的数据映射机制,由 $apply 或 $digest 触发. 脏检查的范围是整个页面,不受区域或组件划分影响 使用尽量简单的绑定表达式提升脏检查执行速度 尽量减少页面 ...

  2. Angular入门到精通系列教程(14)- Angular 编译打包 & Docker发布

    目录 1. 概要 2. 编译打包 2.1. 基本打包命令 2.2. 打包部署到二级目录 3. Angular站点的发布 3.1. web服务器发布 3.2. 使用docker发布 4. 总结 环境: ...

  3. angular源码分析:injector.js文件分析——angular中的依赖注入式如何实现的(续)

    昨天晚上写完angular源码分析:angular中jqLite的实现--你可以丢掉jQuery了,给今天定了一个题angular源码分析:injector.js文件,以及angular的加载流程,但 ...

  4. 【Angular专题】——(2)【译】Angular中的ForwardRef

    原文地址:https://blog.thoughtram.io/angular/2015/09/03/forward-references-in-angular-2.html 作者:Christoph ...

  5. [Angular] Fetch non-JSON data by specifying HttpClient responseType in Angular

    By default the new Angular Http client (introduced in v4.3.1) uses JSON as the data format for commu ...

  6. [Angular] Create a custom validator for reactive forms in Angular

    Also check: directive for form validation User input validation is a core part of creating proper HT ...

  7. angular 子路由跳转出现Navigation triggered outside Angular zone, did you forget to call ‘ngZone.run() 的问题修复

    angular 路由功能非常强大,同时angular的路由也非常脆弱,非常容易出现错误. 那么在我们遇到异常时,首先要做的是什么? 第一步:检查代码,对比官方文档,发现代码中不一致的地方进行改正. 第 ...

  8. [Angular] Show a Loading Indicator for Lazy Routes in Angular

    We can easily code split and lazy load a route in Angular. However when the user then clicks that la ...

  9. Angular05 angular架构、搭建angular开发环境、组件必备三要素、angular启动过程

    1 angular架构 1.1 组件:是angular应用的基本构建模块,可以理解为一段带有业务逻辑和数据的HTML 1.2 服务:用来封装可重用的业务逻辑 1.3 指令:允许你想HTML元素添加自定 ...

随机推荐

  1. ORAchk - 数据库配置检查工具

    1.概要2.下载和安装3.如何执行4.执行过程5.报告6.参考 1.概要 ORAchk之前被称为RACcheck,后来它的检查范围进行了扩展,改名为了ORAchk,它是在数据库系统进行健康检查的一个专 ...

  2. Python--递归函数实现:多维嵌套字典数据无限遍历

    原创:多层嵌套字典无限遍历,实现当value值以特殊字符$开头,并且等于某项值时,用随机函数替换该参数 """处理前的字典{'patient': {'avatarPic' ...

  3. PAT(B) 1028 人口普查(C)字符串

    题目链接:1028 人口普查 (20 point(s)) 题目描述 某城镇进行人口普查,得到了全体居民的生日.现请你写个程序,找出镇上最年长和最年轻的人. 这里确保每个输入的日期都是合法的,但不一定是 ...

  4. 通用32位CPU 常用寄存器及其作用

    目录 32位CPU所含有的寄存器 数据寄存器 变址寄存器 指针寄存器 段寄存器 指令指针寄存器 标志寄存器 32位CPU所含有的寄存器 4个数据寄存器(EAX.EBX.ECX和EDX) 2个变址和指针 ...

  5. Mybatis之关联关系(一对多、多对多)

    目的: Mybatis关系映射之一对多 Mybatis关系映射之多对多 Mybatis关系映射之一对多 一对多 (订单对应多个订单项) 多对一  (订单项对应一个订单) 其是映射关系的基层思维是一样的 ...

  6. High load average analyze

    https://www.tummy.com/articles/isolating-heavy-load/ https://www.tecmint.com/understand-linux-load-a ...

  7. 监控SQL:通过SQL Server的DML触发器来监控哪些IP对表的数据进行了修改(2)

    原文:监控SQL:通过SQL Server的DML触发器来监控哪些IP对表的数据进行了修改(2) 在有些公司中,由于管理的不规范,或者是便于开发人员直接修改.部署程序,往往任何开发人员,都能登录到生产 ...

  8. VS.NET(C#-2.5)_简单例子(所有控件都转换成HTML控件)

    简单例子 UI设计视图  UI代码视图 <% @PageLanguage="C#" AutoEventWireup="true"CodeFile=&quo ...

  9. SQL Server2008数据库报错与解决方法

    一. 报错信息 启动MSSQLSERVER时有以下报错信息 打开SQL SERVER配置管理器,发现以下情况报错: 原因:由于先前安装了2005版VS,然后又安装了2015版VS 解决办法:卸载Loc ...

  10. 自己用ansible加shell 写的自动安装kubernetes的脚本

    脚本地址:https://github.com/shatianxiaozi/auto_install_k8s.git 1. 下载 git clone https://github.com/shatia ...