Angular 项目迁移后第一次 build 打包后抛出了如下的异常提示:
bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 642.91 kB with a total of 1.63 MB.
大致意思是 build 的文件大小已超出了初始设定的范围;
解决办法
在项目工程中的 angular.json 中修改内存的参数设定值即可,具体 code 如下:

"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
],
修改其参数后,重新尝试 build 即可.
以上便是此次分享的全部内容,希望能对大家有所帮助!
网友评论