smmorneau / tour-of-heroes

Angular 2 Starter Project in Typescript with Linting, Minifying, and Bundling
https://tour-of-heroes-typescript.herokuapp.com/
40 stars 27 forks source link

System.import('app').catch(function (err) { console.error(err); }); #3

Closed mchamo closed 8 years ago

mchamo commented 8 years ago

Maybe I am missing something, but, how is this getting around the need to import the app module, like the angular.io documentation shows? I see that items are getting bundled into two js files, one for vendors and one for application code (including main.ts). Then, these two bundles are added as script tags in index.html. I'm still not sure how you end-up telling SystemJS to import the app. The reason I ask is that my app isn't loading anything when I try to setup similar bundles, and when I do try to do the below, then, I do console errors, about an 'unexpected token'. My app works just fine without the bundling piece. But, I am looking to improve the performance of page requests, hence the desire to bundle.

Thanks in advance for your feedback!

mchamo commented 8 years ago

I found my answer. This was a SystemJS Builder newbie mistake by me. When using buildStatic of SystemJS Builder, there is no need to do a system.import.