Angular 角度7,预算中的警告,超出最大值,未';我不明白怎么了?
我有一个角度7应用程序 当我使用--prod构建项目时,我在预算中有一个警告Angular 角度7,预算中的警告,超出最大值,未';我不明白怎么了?,angular,webpack,bundle,angular7,Angular,Webpack,Bundle,Angular7,我有一个角度7应用程序 当我使用--prod构建项目时,我在预算中有一个警告 angular.json "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/tbc-capital-web", "index": "src/index.html", "m
angular.json
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/tbc-capital-web",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/env.js",
"src/web.config"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
生成输出映像:
问题是我不明白这里出了什么问题
没有一个文件超过2mb
问题1:生成的一个或多个文件触发此警告
问题2:在angular.json
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/tbc-capital-web",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets",
"src/env.js",
"src/web.config"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
如果您不仅提供答案,而且提供一些解释,那就太好了。预算是什么意思?
绩效预算是对特定值的一组限制,这些值
影响现场性能,这在设计和施工中可能不会超过
任何网络项目的开发
在我们的案例中,预算是捆绑大小的限制
另见:
angular.json
包并找到以下内容:
"budgets": [{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}]
只要更改值,它就不会再次弹出警告