title: how to specify the RXJS files needed for an Angular2 app
body: <p>I'm getting started with an Angular2 app.  My very simple Angular2 app is very slow to load.  I noticed a lot of different RXJS files are initially loaded.  Are all of these RXJS files needed?  Is there a way to limit what RXJS files get loaded?  My Angular 2 app is getting all of the related RXJS files from node_modules.  What's the best way to optimize RXJS?</p>
  
  <p>Here is my app.component file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { Component } from '@angular/core';
  import { ROUTER_DIRECTIVES } from '@angular/router';
  
  @Component
   ({
    moduleId: module.id,
    selector: 'my-app',
    templateUrl: './app.component.html',
    directives: [ROUTER_DIRECTIVES]
   })
  
  export class AppComponent
  {
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>here is my system.config.js:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/**
   * System configuration for Angular 2 samples
   * Adjust as necessary for your application needs.
   */
  (function (global)
  {
   // map tells the System loader where to look for things
   var map =
    {
     'app': '', // 'dist',
     '@angular': '/lib/@angular',
     'angular2-in-memory-web-api': '/lib/angular2-in-memory-web-api',
     'gitana': '/lib/gitana/gitana.min.js',
     'rxjs': '/lib/rxjs'
    };
  
   // packages tells the System loader how to load when no filename and/or no extension
   var packages =
    {
     'app': { main: 'app/main.js', defaultExtension: 'js' },
     'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
     'rxjs': { defaultExtension: 'js' }
    };
  
   var ngPackageNames =
    [
     'common',
     'compiler',
     'core',
     'forms',
     'http',
     'platform-browser',
     'platform-browser-dynamic',
     'router',
     'router-deprecated',
     'upgrade',
    ];
  
   // Individual files (~300 requests):
   function packIndex(pkgName)
   {
    packages[ '@angular/' + pkgName ] = { main: 'index.js', defaultExtension: 'js' };
   }
  
   // Bundled (~40 requests):
   function packUmd(pkgName)
   {
    packages[ '@angular/' + pkgName ] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
   }
  
   // Most environments should use UMD; some (Karma) need the individual index files
   var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
  
   // Add package entries for angular packages
   ngPackageNames.forEach(setPackageConfig);
  
   var config =
    {
     map: map,
     packages: packages
    };
  
   System.config(config);
  })(this);</code></pre>
  </div>
  </div>
  </p>