当我设置sourceMaps = true并且环境为生产时,角度构建卡住了

时间:2019-01-30 18:11:17

标签: angular-cli

当我在下面将sourceMap设置为true时,我的Web项目的cli cli构建会花费很长时间。我一直在等待约40分钟以上,但是构建尚未完成,否则,如果将其设置为false,它会在45秒内完成。谁能建议我如何找出造成这种速度缓慢的原因或原因?

我称之为ng build --configuration = production。

我正在使用以下版本

 node - v8.9.4    
 npm - 5.6.0  

 **ng package version**    

 Package                      Version
 ------------------------------------------------------ 
 @angular-devkit/architect    0.12.3 
 @angular-devkit/core         7.2.3
 @angular-devkit/schematics   7.2.3 
 @angular/cli                 7.2.3
 @schematics/angular          7.2.3 
 @schematics/update           0.12.3
 rxjs                         6.3.3 
 typescript                   3.2.2

下面是我的用于生产的 angular.json 配置。

"configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": true,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]

我的 package.json 文件如下

{
  "name": "test-web",
  "version": "0.0.1",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build-prod": "ng build --configuration=production",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.0",
    "@angular/common": "6.0.0",
    "@angular/compiler": "6.0.0",
    "@angular/core": "6.0.0",
    "@angular/forms": "6.0.0",
    "@angular/http": "6.0.0",
    "@angular/platform-browser": "6.0.0",
    "@angular/platform-browser-dynamic": "6.0.0",
    "@angular/router": "6.0.0",
    "@fortawesome/angular-fontawesome": "0.1.0-10",
    "@fortawesome/fontawesome-svg-core": "1.2.0",
    "@fortawesome/free-solid-svg-icons": "5.1.0",
    "@ng-bootstrap/ng-bootstrap": "2.0.0",
    "bootstrap": "^4.0.0-beta.2",
    "core-js": "^2.4.1",
    "devextreme": "^17.2.4",
    "devextreme-angular": "^17.2.4",
    "moment": "^2.22.2",
    "rxjs": "^6.1.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.0",
    "@angular/cli": "^6.0.0",
    "@angular/compiler-cli": "6.0.0",
    "@angular/language-service": "6.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "4.3.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "5.10.0",
    "typescript": "2.7.2"
  }
}

0 个答案:

没有答案