[英]After upgrading my project to Angular 8 from Angular 7.2, compile time increased 3 times. How can I fix it
我將我的項目升級到Angular 8版本。 在升級過程中,我沒有遇到任何錯誤。 但編譯時間增加了3次而沒有任何錯誤。 至少,我怎樣才能獲得舊的編譯時間?
** PS:這個問題有一個錯誤原因。 與此錯誤有關的問題** https://github.com/angular/angular-cli/issues/13734
Last Compile Before Angular 8 (with Angular 7.2)
Time: 1382.536ms -> main.cf29a89468d732f3f363.js (main) 12.4 MB
First Compile After Upgrading to Angular 8
Time: 6379.317ms -> main.da4147c72278bc767ee4.js (main) 12.3 MB
Second Compile After Upgrading to Angular 8 and After restart PC
Time: 3147.254ms -> main.da4147c72278bc767ee4.js (main) 12.3 MB
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "./",
"moduleResolution": "node",
"outDir": "../__dist_cli",
"sourceMap": true,
"target": "es5 ",
"module": "es2015",
"lib": [
"es2016",
"dom"
],
"typeRoots": [
"node_modules/@types",
"typings/custom"
]
}
Angular CLI: 8.0.0
Node: 12.3.1
OS: win32 x64
Angular: 8.0.0
嘗試使用命令構建包
ng build --es5BrowserSupport=false
這將只為現代瀏覽器生成包。 這將幫助您確定差異裝載包裝建築是否需要額外的時間。
在Angular CLI的更新版本中解決了此問題(^ 8.2.1)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.