title: Angular2 RC4 build with tree shaking runtime error
body: <p>I tried to build my test app with tree shaking according to this post.
  <a href="http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/" rel="nofollow">http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/</a></p>
  
  <p>The build scripts runs OK but then I got runtime error when I used the bundle.js.</p>
  
  <pre><code>  zone.js@0.6.12?main=browser:461 Unhandled Promise rejection: Observable$1.from is not a function ; 
    Zone: angular ; Task: Promise.then ; Value: TypeError: Observable$1.from is not a function(…)
  </code></pre>
  
  <p>Observable$1.from came from dist\bundle.es2015.js</p>
  
  <pre><code>  dist\bundle.es2015.js 48604                   return Observable$1.from(this.checks)
    dist\bundle.es2015.js 48624                   return Observable$1.from(this.checks)
    dist\bundle.es2015.js 48697                   return Observable$1.from(canActivate)
    dist\bundle.es2015.js 48714                   return Observable$1.from(canDeactivate)
  </code></pre>
  
  <p>This function originated from </p>
  
  <pre><code>  node_modules\@angular\router\esm\src\router.js    361         return Observable.from(this.checks)
    node_modules\@angular\router\esm\src\router.js    381         return Observable.from(this.checks)
    node_modules\@angular\router\esm\src\router.js    454         return Observable.from(canActivate)
    node_modules\@angular\router\esm\src\router.js    471         return Observable.from(canDeactivate)
  </code></pre>
  
  <p>when I use rollup to generate dist\bundle.es2015.js</p>
  
  <p>If I build the app without tree shaking via browserify-js then this function appears as Observable_1.from() and the app works with no error.</p>
  
  <p>I thought may be Angular2 zone.js is allergic to Observable$1 so I manually change all Observable$1 to Observable_1 in bundle.es2015.js and then run</p>
  
  <pre><code>"es5": "tsc --target es5 --allowJs dist/bundle.es2015.js --out dist/bundle.js",
  </code></pre>
  
  <p>Then I got this</p>
  
  <pre><code>  Unhandled Promise rejection: Observable_1.from is not a function ; 
    Zone: angular ; Task: Promise.then ; Value: TypeError: Observable_1.from is not a function(…)
  </code></pre>
  
  <p>Can anyone tell me if this is due to a rollup bug or I missed something?</p>
  
  <p>Here is the build scripts</p>
  
  <pre><code>"scripts": {
    "clean": "rm -rf dist",
    "typings": "typings install",
    "serve": "http-server . -p 5557",
    "postinstall": "npm run typings",
    "build": "tsc -p tsconfig.json",
    "rollup": "rollup -f iife -c -o dist/bundle.es2015.js",
    "es5": "tsc --target es5 --allowJs dist/bundle.es2015.js --out dist/bundle.js",
    "minify": "uglifyjs dist/bundle.js --screw-ie8 --compress --mangle --output dist/bundle.min.js",
    "build_prod": "npm run clean &amp;&amp; npm run build &amp;&amp; npm run rollup &amp;&amp; npm run es5 &amp;&amp; npm run minify"
  }
  </code></pre>
  
  <p>The rollup.config.js and tsconfig.json is the same as in the link above.</p>