title: Angular 4 - XMLHttpRequest is not defined when debugging
body: <p>I'm having an issue with vscode debugger. The first issue I had when I tried it was (by the way the project works just fine when I launch it without debugging):</p>
  
  <blockquote>
    <p>reflect-metadata shim is required when using class decorators</p>
  </blockquote>
  
  <p>I saw on other posts that I have to include Reflect.js and zone.js to the angular-cli.json (yes I generated the app with angular-cli) of my project. When I did that the first error disapeared but I still got the one I mentioned in the title.</p>
  
  <p>The full issue is:</p>
  
  <blockquote>
    <p>ReferenceError: XMLHttpRequest is not defined
        at patchXHR (c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:2895:54)
        at c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:2882:5
        at Function.Zone.__load_patch (c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:86:33)
        at c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:2880:6
        at FUNCTION (c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:9:65)
        at Object. (c:\Users\axileo\Documents\angular-bc\node_modules\zone.js\dist\zone.js:12:2)
        at Module._compile (module.js:624:30)
        at Object.Module._extensions..js (module.js:635:10)
        at Module.load (module.js:545:32)
        at tryModuleLoad (module.js:508:12)</p>
  </blockquote>
  
  <p>Here's my angular-cli.json:</p>
  
  <pre><code>{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "project": {
      "name": "angular-bc"
    },
    "apps": [
      {
        "root": "src",
        "outDir": "dist",
        "assets": [
          "assets",
          "favicon.ico"
        ],
        "index": "index.html",
        "main": "main.ts",
        "polyfills": "polyfills.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.app.json",
        "testTsconfig": "tsconfig.spec.json",
        "prefix": "app",
        "styles": [
          "styles.css"
        ],
        "scripts": ["node_modules/zone.js/dist/zone.js", 
        "node_modules/reflect-metadata/Reflect.js"
        ],
        "environmentSource": "environments/environment.ts",
        "environments": {
          "dev": "environments/environment.ts",
          "prod": "environments/environment.prod.ts"
        }
      }
    ],
    "e2e": {
      "protractor": {
        "config": "./protractor.conf.js"
      }
    },
    "lint": [
      {
        "project": "src/tsconfig.app.json",
        "exclude": "**/node_modules/**"
      },
      {
        "project": "src/tsconfig.spec.json",
        "exclude": "**/node_modules/**"
      },
      {
        "project": "e2e/tsconfig.e2e.json",
        "exclude": "**/node_modules/**"
      }
    ],
    "test": {
      "karma": {
        "config": "./karma.conf.js"
      }
    },
    "defaults": {
      "styleExt": "css",
      "component": {}
    }
  }
  </code></pre>
  
  <p>Thanks</p>