ABC*_*ABC 3 javascript node.js typescript angular angular8
如何ng build project在不编辑 angular.json 的情况下修复in angular
这是错误
Your global Angular CLI version (8.3.16) is greater than your local
version (8.1.3). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
chunk {0} runtime-es2015.52e4031f7f0d4c5547f5.js (runtime) 2.25 kB [entry] [rendered]
chunk {1} main-es2015.4e8665ff7ceef4e442ee.js (main) 4.62 MB [initial] [rendered]
chunk {2} polyfills-es2015.556027bb8b3cb9b5932e.js (polyfills) 173 kB [initial] [rendered]
chunk {3} styles.26e824d23ac01d2a1ba0.css (styles) 695 kB [initial] [rendered]
chunk {4} 4-es2015.823687dfc617d3f0d9c2.js () 3.43 kB [rendered]
chunk {5} 5-es2015.f2106b47214935964e1d.js () 2.76 kB [rendered]
Date: 2019-11-12T03:49:07.167Z - Hash: a28b3171138b993d899e - Time: 134373ms
WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 3.47 MB.
ERROR in budgets, maximum exceeded for initial. Budget 5 MB was exceeded by 483 kB.
Run Code Online (Sandbox Code Playgroud)
提前致谢。
到 92% 时出现错误,错误在上面。
更新:我看到您的编辑问题。对于简短的回答,您只能通过使用webpack-bundle-analyzer分析包大小并查看哪个包影响您的包大小并将其删除来修复
您可以在 angular.json 中看到预算的配置如下所示
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
],
Run Code Online (Sandbox Code Playgroud)
删除它,您可以无误地构建。但我不建议你删除它,因为这个配置会让你知道你的应用程序的大小,你可以通过删除不必要的代码来减少应用程序的大小来提高应用程序的性能。
您可以从这里获得更多信息:https : //angular.io/guide/build#configuring-size-budgets
| 归档时间: |
|
| 查看次数: |
7988 次 |
| 最近记录: |