热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

E:/project/超出最大预算错误

早上好,我已经创建了我的项目,现在我想用ngbuild--prad命令输出,但是我遇到了错误。我该如何解决这个错误?我猜问题来自以下代码,但我不知道如何解决

早上好,我已经创建了我的项目,现在我想用 ng build --prad 命令输出,但是我遇到了错误。我该如何解决这个错误?我猜问题来自以下代码,但我不知道如何解决

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

终端错误:

ng build --prod
WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/layout-dialog/dialog-successful/dialog-successful.component.scss. Budget 6 kB was not met by 17.4 kB with a total of 23.4 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/login/login.component.scss. Budget 6 kB was not met by 201 kB with a total
of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/about-me/about-me.component.scss. Budget 6 kB was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/header-admin/header-admin.component.scss. Budget 6 kB was not met by
201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-documents/show-documents.component.scss. Budget 6 kB was not met
by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-expertise/show-expertise.component.scss. Budget 6 kB was not met
by 204 kB with a total of 210 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-records/show-records.component.scss. Budget 6 kB was not met by 200 kB with a total of 206 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/contact-me/contact-me.component.scss. Budget 6 kB was not met by 202 kB with a total of 208 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/about-me-admin/about-me-admin.component.scss. Budget 6 kB was
not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/documents-admin/documents-admin.component.scss. Budget 6 kB was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/expertise-admin/expertise-admin.component.scss. Budget 6 kB was not met by 204 kB with a total of 210 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/messages-admin/messages-admin.component.scss. Budget 6 kB was
not met by 200 kB with a total of 206 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/records-admin/records-admin.component.scss. Budget 6 kB was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/home.component.scss. Budget 6 kB was not met by 225 kB with a total of 231 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/records-admin/ae-record/ae-record.component.scss. Budget 6 kB
was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/documents-admin/ae-documents/ae-documents.component.scss. Budget 6 kB was not met by 200 kB with a total of 206 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/about-me-admin/edit-about-me-admin/edit-about-me-admin.component.scss. Budget 6 kB was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/expertise-admin/ae-expertise/ae-expertise.component.scss. Budget 6 kB was not met by 201 kB with a total of 207 kB. WARNING in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/layout-dialog/dialog-delete/dialog-delete.component.scss. Budget 6 kB was not met by 224 kB with a total of 230 kB. ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/layout-dialog/dialog-successful/dialog-successful.component.scss. Budget 10 kB was not met by 13.4 kB with a total of 23.4 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/login/login.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/about-me/about-me.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/header-admin/header-admin.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-documents/show-documents.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-expertise/show-expertise.component.scss. Budget 10 kB was not met by 200 kB with a total of 210 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/show-records/show-records.component.scss. Budget 10 kB was not met by 196 kB with a total of 206 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/contact-me/contact-me.component.scss. Budget 10 kB was not met by 198 kB with a total of 208 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/about-me-admin/about-me-admin.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/documents-admin/documents-admin.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/expertise-admin/expertise-admin.component.scss. Budget 10 kB was not met by 200 kB with a total of 210 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/messages-admin/messages-admin.component.scss. Budget 10 kB was not met by 196 kB with a total of 206 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/records-admin/records-admin.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/home/home.component.scss. Budget 10 kB was not met by 221 kB with a total of
231 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/records-admin/ae-record/ae-record.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/documents-admin/ae-documents/ae-documents.component.scss. Budget 10 kB was not met by 196 kB with a total of 206 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/about-me-admin/edit-about-me-admin/edit-about-me-admin.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/expertise-admin/ae-expertise/ae-expertise.component.scss. Budget 10 kB was not met by 197 kB with a total of 207 kB.
ERROR in Exceeded maximum budget for E:/project/PwpEnd/PWP/src/app/layout/admin/layout/layout-dialog/dialog-delete/dialog-delete.component.scss. Budget 10 kB was not met by 220 kB with a total of 230 kB.

角度.json:

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"PWP": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/PWP",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"./node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"./node_modules/bootstrap/dist/js/bootstrap.js",
"./node_modules/bootstrap/dist/js/bootstrap.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "PWP:build"
},
"configurations": {
"production": {
"browserTarget": "PWP:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "PWP:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "PWP:serve"
},
"configurations": {
"production": {
"devServerTarget": "PWP:serve:production"
}
}
}
}
}
},
"defaultProject": "PWP",
"cli": {
"analytics": "c792c032-9136-42b5-8b0a-391b6f8d84c5"
}
}

pakege.json:

{
"name": "pwp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~9.1.7",
"@angular/cdk": "^9.2.4",
"@angular/common": "~9.1.7",
"@angular/compiler": "~9.1.7",
"@angular/core": "~9.1.7",
"@angular/forms": "~9.1.7",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "~9.1.7",
"@angular/platform-browser-dynamic": "~9.1.7",
"@angular/router": "~9.1.7",
"bootstrap": "^4.6.0",
"jquery": "^3.5.1",
"jspdf": "^2.3.0",
"ngx-COOKIE-service": "^11.0.2",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.6",
"@angular/cli": "~9.1.6",
"@angular/compiler-cli": "~9.1.7",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/jspdf": "^1.3.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
}
}

app.routing.module.ts:

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ValidTokenRoutingGuard } from './valid-token-routing/valid-token-routing-guard';
const routes: Routes = [
{ path: '', loadChildren: () => import('./layout/home/home.module').then(m => m.HomeModule) },
{ path: 'Admin', canActivate: [ValidTokenRoutingGuard], loadChildren: () => import('./layout/admin/admin.module').then(m => m.AdminModule) },
{ path: 'Login', loadChildren: () => import('./layout/login/login.module').then(m => m.LoginModule) },
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
})

回答


这是一个编译器错误,因此您会注意到您的文件低于定义的大小。只需修改 angular.json 中的配置并增加maximumErrorsize 属性以满足您的需求并再次构建。我还建议检查您的项目以删除任何未使用的代码或依赖项,从而减小大小。






推荐阅读
  • 在高并发需求的C++项目中,我们最初选择了JsonCpp进行JSON解析和序列化。然而,在处理大数据量时,JsonCpp频繁抛出异常,尤其是在多线程环境下问题更为突出。通过分析发现,旧版本的JsonCpp存在多线程安全性和性能瓶颈。经过评估,我们最终选择了RapidJSON作为替代方案,并实现了显著的性能提升。 ... [详细]
  • 深入解析Spring启动过程
    本文详细介绍了Spring框架的启动流程,帮助开发者理解其内部机制。通过具体示例和代码片段,解释了Bean定义、工厂类、读取器以及条件评估等关键概念,使读者能够更全面地掌握Spring的初始化过程。 ... [详细]
  • 在创建新的Android项目时,您可能会遇到aapt错误,提示无法打开libstdc++.so.6共享对象文件。本文将探讨该问题的原因及解决方案。 ... [详细]
  • 采用IKE方式建立IPsec安全隧道
    一、【组网和实验环境】按如上的接口ip先作配置,再作ipsec的相关配置,配置文本见文章最后本文实验采用的交换机是H3C模拟器,下载地址如 ... [详细]
  • 本文探讨了如何通过预处理器开关选择不同的类实现,并解决在特定情况下遇到的链接器错误。 ... [详细]
  • This post discusses an issue encountered while using the @name annotation in documentation generation, specifically regarding nested class processing and unexpected output. ... [详细]
  • 软件工程课堂测试2
    要做一个简单的保存网页界面,首先用jsp写出保存界面,本次界面比较简单,首先是三个提示语,后面是三个输入框,然 ... [详细]
  • 本文探讨了使用C#在SQL Server和Access数据库中批量插入多条数据的性能差异。通过具体代码示例,详细分析了两种数据库的执行效率,并提供了优化建议。 ... [详细]
  • 深入理解Lucene搜索机制
    本文旨在帮助读者全面掌握Lucene搜索的编写步骤、核心API及其应用。通过详细解析Lucene的基本查询和查询解析器的使用方法,结合架构图和代码示例,带领读者深入了解Lucene搜索的工作流程。 ... [详细]
  • 本文介绍了如何在多线程环境中实现异步任务的事务控制,确保任务执行的一致性和可靠性。通过使用计数器和异常标记字段,系统能够准确判断所有异步线程的执行结果,并根据结果决定是否回滚或提交事务。 ... [详细]
  • ElasticSearch 集群监控与优化
    本文详细介绍了如何有效地监控 ElasticSearch 集群,涵盖了关键性能指标、集群健康状况、统计信息以及内存和垃圾回收的监控方法。 ... [详细]
  • ssm框架整合及工程分层1.先创建一个新的project1.1配置pom.xml ... [详细]
  • 在编译BSP包过程中,遇到了一个与 'gets' 函数相关的编译错误。该问题通常发生在较新的编译环境中,由于 'gets' 函数已被弃用并视为安全漏洞。本文将详细介绍如何通过修改源代码和配置文件来解决这一问题。 ... [详细]
  • Linux环境下进程间通信:深入解析信号机制
    本文详细探讨了Linux系统中信号的生命周期,从信号生成到处理函数执行完毕的全过程,并介绍了信号编程中的注意事项和常见应用实例。通过分析信号在进程中的注册、注销及处理过程,帮助读者理解如何高效利用信号进行进程间通信。 ... [详细]
  • thereissomethingstrangeinmycode.Imsuretoforgetsomethingbutidontknowwhat.Itryto ... [详细]
author-avatar
cc辰辰cc小宝宝
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有