热门标签 | 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 属性以满足您的需求并再次构建。我还建议检查您的项目以删除任何未使用的代码或依赖项,从而减小大小。






推荐阅读
  • 利用HTML5 Canvas高效构建电信网络拓扑图
    电信网络拓扑图在实际应用中具有很高的实用价值。本文介绍了一个基于HTML5 Canvas的电信网络拓扑图项目,不仅实现了基本的图形展示功能,还加入了自动布局和属性栏功能,使项目更加完善。此Demo经过细微调整即可直接应用于实际项目中。 ... [详细]
  • 采用IKE方式建立IPsec安全隧道
    一、【组网和实验环境】按如上的接口ip先作配置,再作ipsec的相关配置,配置文本见文章最后本文实验采用的交换机是H3C模拟器,下载地址如 ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • 深入解析 Spring Security 用户认证机制
    本文将详细介绍 Spring Security 中用户登录认证的核心流程,重点分析 AbstractAuthenticationProcessingFilter 和 AuthenticationManager 的工作原理。通过理解这些组件的实现,读者可以更好地掌握 Spring Security 的认证机制。 ... [详细]
  • 作为一名专业的Web前端工程师,掌握HTML和CSS的命名规范是至关重要的。良好的命名习惯不仅有助于提高代码的可读性和维护性,还能促进团队协作。本文将详细介绍Web前端开发中常用的HTML和CSS命名规范,并提供实用的建议。 ... [详细]
  • 本文详细介绍了在 Windows 2000 系统中启用 TELNET 服务时需要注意的 NTLM 配置问题,帮助用户解决常见的身份验证失败错误。 ... [详细]
  • 本文详细介绍如何利用已搭建的LAMP(Linux、Apache、MySQL、PHP)环境,快速创建一个基于WordPress的内容管理系统(CMS)。WordPress是一款流行的开源博客平台,适用于个人或小型团队使用。 ... [详细]
  • 本文介绍如何使用 Android 的 Canvas 和 View 组件创建一个简单的绘图板应用程序,支持触摸绘画和保存图片功能。 ... [详细]
  • 本文介绍如何使用 Angular 6 的 HttpClient 模块来获取 HTTP 响应头,包括代码示例和常见问题的解决方案。 ... [详细]
  • Python + Pytest 接口自动化测试中 Token 关联登录的实现方法
    本文将深入探讨 Python 和 Pytest 在接口自动化测试中如何实现 Token 关联登录,内容详尽、逻辑清晰,旨在帮助读者掌握这一关键技能。 ... [详细]
  • ssm框架整合及工程分层1.先创建一个新的project1.1配置pom.xml ... [详细]
  • 软件工程课堂测试2
    要做一个简单的保存网页界面,首先用jsp写出保存界面,本次界面比较简单,首先是三个提示语,后面是三个输入框,然 ... [详细]
  • 深入解析:OpenShift Origin环境下的Kubernetes Spark Operator
    本文探讨了如何在OpenShift Origin平台上利用Kubernetes Spark Operator来管理和部署Apache Spark集群与应用。作为Radanalytics.io项目的一部分,这一开源工具为大数据处理提供了强大的支持。 ... [详细]
  • 本文详细探讨了在微服务架构中,使用Feign进行远程调用时出现的请求头丢失问题,并提供了具体的解决方案。重点讨论了单线程和异步调用两种场景下的处理方法。 ... [详细]
  • 本文介绍如何利用QFileSystemModel进行目录的浏览、创建及删除操作,并提供了一个简单的对话框界面实现。 ... [详细]
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社区 版权所有