文章内容

2020/7/22 10:06:40,作 者: 黄兵

Budget 15 kB was not met by 66 bytes with a total of 15.1 kB.

今天在修改Angualr代码的时候,增加了几个样式,编译的时候报出如下错误:

Budget 15 kB was not met by 66 bytes with a total of 15.1 kB.

出现这个问题的原因:

性能预算是对影响网站性能的某些值的一组限制,在任何Web项目的设计和开发中都不能超过这些限制。

也就是说:为了性能考虑,css文件不能太大,否则加载缓慢。

解决方案:

打开angular.json文件并查找budgets关键字。

它应该看起来像:

"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "15kb"
}
],

修改maximumError数值,避免错误。


参考资料:

1、WARNING in budgets, maximum exceeded for initial


黄兵个人博客原创。

转载请注明出处:黄兵个人博客 - Budget 15 kB was not met by 66 bytes with a total of 15.1 kB.

Ubuntu 更改时区
angular adsense
分享到:

发表评论

评论列表