title: Maximum call stack size exceeded for build with Angular CLI
body: <p>I have a large project which was till now running on webpack and all was working well with angular@4.3.3. Today I planned to shift the same to ng-cli to exploit features like universal. Everything is working well and good except when i try to build the project in prod/prod+aot i am getting: Maximum call stack size exceeded.</p>
  
  <p>Checked various place for the issue and most of people are telling to check for circular dependency. But as per the latest cli@1.2.7 the circular dependency should have been shown build time, which is not the case. I was planning to increase node virtual machine stack size but couldn't figure out to achieve that. I don't want to use ng eject and get into the webpack mess again.</p>
  
  <p>Are there some other approaches or solutions out there with cli@1.2.7</p>
  
  <p>Thanks</p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "name": "test-project",
    "version": "0.0.0",
    "license": "MIT",
    "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e"
    },
    "private": true,
    "dependencies": {
      "@angular/common": "~4.3.3",
      "@angular/compiler": "~4.3.3",
      "@angular/core": "~4.3.3",
      "@angular/forms": "~4.3.3",
      "@angular/http": "~4.3.3",
      "@angular/animations": "~4.3.3",
      "@angular/flex-layout": "^2.0.0-beta.8",
      "@angular/material": "^2.0.0-beta.8",
      "@angular/cdk": "^2.0.0-beta.8",
      "@angular/platform-browser": "~4.3.3",
      "@angular/platform-browser-dynamic": "~4.3.3",
      "@angular/platform-server": "~4.3.3",
      "@angular/router": "~4.3.3",
      "angular2-highcharts": "~0.5.5",
      "@types/highcharts": "~4.2.57",
      "angular-2-local-storage" : "^1.0.1",
      "ngx-infinite-scroll": "^0.5.1",
      "jspdf" : "^1.3.3",
      "@types/jspdf" : "^1.1.31",
      "jspdf-autotable" : "^2.3.2",
      "html2canvas": "^0.5.0-beta4",
      "@types/html2canvas": "^0.5.34",
      "core-js": "^2.4.1",
      "jasmine-core": "^2.6.4",
      "reflect-metadata": "^0.1.10",
      "rxjs": "^5.4.1",
      "moment": "^2.18.1",
      "zone.js": "^0.8.14",
      "angular2-jwt" : "^0.2.3",
      "@types/modernizr": "3.3.0"
    },
    "devDependencies": {
      "@angular/language-service": "^4.0.0",
      "@angular/compiler-cli": "~4.3.3",
      "@angular/platform-server": "~4.3.3",
      "@angular/cli": "1.2.7",
      "hammerjs": "^2.0.8",
      "hammer-timejs" : "^1.1.0",
      "@types/hammerjs": "^2.0.34",
      "@types/jasmine": "^2.5.53",
      "@types/jasminewd2": "~2.0.2",
      "@types/node": "~6.0.60",
      "codelyzer": "~3.1.1",
      "jasmine-core": "^2.6.4",
      "jasmine-spec-reporter": "~4.1.0",
      "karma": "^1.7.0",
      "karma-chrome-launcher": "^2.2.0",
      "karma-coverage": "^1.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.1.0",
      "tslib": "^1.7.1",
      "tslint": "~5.4.3",
      "typescript": "^2.4.1"
    }
  }
  </code></pre>