title: Angular2 + Webpack UncaughtReferenceError __decorate is not defined
body: <p>After trying to migrate a functioning angular2 typescript app to webpack I get the following runtime error</p>
  
  <pre><code>app.js:38016Uncaught ReferenceError: __decorate is not defined
  </code></pre>
  
  <p>The code at the line where it blows up looks like this</p>
  
  <pre><code>NpnPortalService = __decorate([
              core_1.Injectable(), 
              __metadata('design:paramtypes', [http_1.Http])
          ], NpnPortalService);
  </code></pre>
  
  <p>Webpack doesn't complain when I do a build and I'm not seeing any typescript compile errors. Here is my webpack.config.js</p>
  
  <pre><code>module.exports = {
      entry: {
          app: "./app/boot",
          polyfills: ['./node_modules/es6-shim/es6-shim.min.js', './node_modules/zone.js/dist/zone.min.js']
      },
      output: {
          path: __dirname + '/dist',
          filename: "[name].js"
      },
      resolve: {
          extensions: ['', '.js', '.ts']
      },
      module: {
          loaders: [{
              test: /\.ts/, loader: 'ts-loader', exclude: /node_modules/
          }],
          noParse: [ './node_modules/es6-shim/es6-shim.min.js' ]
      }
  };
  </code></pre>
  
  <p>Here is my tsconfig.js</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es5",
      "module": "commonjs",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "sourceMap": true,
      "noEmitHelpers": true
    },
    "files": [
      "app.component.ts",
      "../node_modules/angular2/typings/browser.d.ts"
    ],
    "compileOnSave": false,
    "buildOnSave": false
  }
  </code></pre>
  
  <p>and here is my index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"&gt;&lt;/script&gt;
  
      &lt;!-- Set the base href --&gt;
      &lt;script&gt;document.write('&lt;base href="' + document.location + '" /&gt;');&lt;/script&gt;
  
      &lt;title&gt;NPN Data Download Tool&lt;/title&gt;
  
      &lt;script src="dist/polyfills.js"&gt;&lt;/script&gt;
  
      &lt;!-- Google Maps Initialization --&gt;
      &lt;script&gt;
        function initMap() {
          var mapDiv = document.getElementById('map_canvas');
          console.log(mapDiv.getAttribute("intialized"));
          if (!mapDiv.getAttribute("intialized")) {
            console.log("intializing google map");
            var map = new google.maps.Map(mapDiv, {
              center: {lat: 40.750289, lng: -89.583163},
              zoom: 5
            });
  
            map.enableKeyDragZoom();
            var dz = map.getDragZoomObject();
  
            google.maps.event.addListener(dz, "dragend", function(bnds) {
  
              document.getElementById("ObservationBottomLeftX1").value = bnds.getSouthWest().lat();
              document.getElementById("ObservationBottomLeftY1").value = bnds.getSouthWest().lng();
              document.getElementById("ObservationUpperRightX2").value = bnds.getNorthEast().lat();
              document.getElementById("ObservationUpperRightY2").value = bnds.getNorthEast().lng();
              document.getElementById("necoords").innerHTML = "&lt;span style='font-weight:bold'&gt;North East Corner&lt;/span&gt;: " + bnds.getNorthEast().lat() + ", " + bnds.getNorthEast().lng();
              document.getElementById("swcoords").innerHTML = "&lt;span style='font-weight:bold'&gt;South West Corner&lt;/span&gt;: " + bnds.getSouthWest().lat() + ", " + bnds.getSouthWest().lng();
            });
  
            google.maps.event.addListener(map, 'zoom_changed',
                function() {
                  if (map.getZoom() &lt; 3) {
                    map.setZoom(3);
                  };
                });
  
            document.getElementById('map_canvas').setAttribute("intialized", true);
          }
        }
      &lt;/script&gt;
      &lt;script src="https://maps.googleapis.com/maps/api/js"&gt;&lt;/script&gt;
      &lt;script src="./keydragzoom.js" type="text/javascript"&gt;&lt;/script&gt;
  
  
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;my-app&gt;loading...&lt;/my-app&gt;
    &lt;/body&gt;
  
    &lt;script src="dist/app.js"&gt;&lt;/script&gt;
  
  
      &lt;!-- Bootstrap --&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
  
      &lt;!-- Override Bootstrap css here --&gt;
      &lt;link rel="stylesheet" href="styles.css"&gt;
  
  
  &lt;/html&gt;
  </code></pre>