title: Angular2 rxjs/Subject import - can't load vendor/rxjs/index.js
body: <p>I haven't changed anything inside angular cli structure. I tried to import Subject from rxjs and create Subject object like this:</p>
  
  <pre><code>import { Subject } from 'rxjs';
  
  @Injectable()
  export class GlobalService {
  
    nameChange: Subject&lt;string&gt; = new Subject&lt;string&gt;();
    ...
  </code></pre>
  
  <p>and there is an error while loading my webpage</p>
  
  <pre><code>zone.js:101 GET http://localhost:4200/vendor/rxjs/index.js 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:336Zone.scheduleMacroTask @ zone.js:273(anonymous function) @ zone.js:122send @ VM35531:3fetchTextFromURL @ system.src.js:1154(anonymous function) @ system.src.js:1735ZoneAwarePromise @ zone.js:584(anonymous function) @ system.src.js:1734(anonymous function) @ system.src.js:2759(anonymous function) @ system.src.js:3333(anonymous function) @ system.src.js:3600(anonymous function) @ system.src.js:3985(anonymous function) @ system.src.js:4448(anonymous function) @ system.src.js:4700(anonymous function) @ system.src.js:406ZoneDelegate.invoke @ zone.js:323Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
  zone.js:461 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/rxjs/index.js
          at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:4200/vendor/zone.js/dist/zone.js:769:30)
          at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38)
          at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48)
          at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34)
      Error loading http://localhost:4200/vendor/rxjs/index.js as "rxjs" from http://localhost:4200/app/global.service.js ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Error: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/rxjs/index.js(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
  zone.js:463 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found) loading http://localhost:4200/vendor/rxjs/index.js(…)
  </code></pre>
  
  <p>index.html system.js load</p>
  
  <pre><code>  &lt;script&gt;
      System.import('system-config.js').then(function () {
        System.import('main');
      }).catch(console.error.bind(console));
    &lt;/script&gt;
  </code></pre>
  
  <p>system.config.ts (js compiled successfully)</p>
  
  <pre><code>// SystemJS configuration file, see links for more information
  // https://github.com/systemjs/systemjs
  // https://github.com/systemjs/systemjs/blob/master/docs/config-api.md
  
  /***********************************************************************************************
   * User Configuration.
   **********************************************************************************************/
  /** Map relative paths to URLs. */
  const map: any = {
    'firebase': 'vendor/firebase/firebase.js',
    'angularfire2': 'vendor/angularfire2'
  };
  
  /** User packages configuration. */
  const packages: any = {
    angularfire2: {
      defaultExtension: 'js',
      main: 'angularfire2.js'
    }
  };
  
  ////////////////////////////////////////////////////////////////////////////////////////////////
  /***********************************************************************************************
   * Everything underneath this line is managed by the CLI.
   **********************************************************************************************/
  const barrels: string[] = [
    // Angular specific barrels.
    '@angular/core',
    '@angular/common',
    '@angular/compiler',
    '@angular/forms',
    '@angular/http',
    '@angular/router',
    '@angular/platform-browser',
    '@angular/platform-browser-dynamic',
  
    // Thirdparty barrels.
    'rxjs',
  
    // App specific barrels.
    'app',
    'app/shared',
    'app/homepage',
    'app/loginpage',
    'app/registerpage',
    /** @cli-barrel */
  ];
  
  const cliSystemConfigPackages: any = {};
  barrels.forEach((barrelName: string) =&gt; {
    cliSystemConfigPackages[barrelName] = { main: 'index' };
  });
  
  /** Type declaration for ambient System. */
  declare var System: any;
  
  // Apply the CLI SystemJS configuration.
  System.config({
    map: {
      '@angular': 'vendor/@angular',
      'rxjs': 'vendor/rxjs',
      'main': 'main.js'
    },
    packages: cliSystemConfigPackages
  });
  
  // Apply the user's configuration.
  System.config({ map, packages });
  </code></pre>
  
  <p>and default angular-cli-build.js</p>
  
  <pre><code>// Angular-CLI build configuration
  // This file lists all the node_modules files that will be used in a build
  // Also see https://github.com/angular/angular-cli/wiki/3rd-party-libs
  
  /* global require, module */
  
  var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
  
  module.exports = function(defaults) {
    return new Angular2App(defaults, {
      vendorNpmFiles: [
        'systemjs/dist/system-polyfills.js',
        'systemjs/dist/system.src.js',
        'zone.js/dist/**/*.+(js|js.map)',
        'es6-shim/es6-shim.js',
        'reflect-metadata/**/*.+(ts|js|js.map)',
        'rxjs/**/*.+(js|js.map)',
        '@angular/**/*.+(js|js.map)',
        'angularfire2/**/*.js',
        'firebase/*.js'
      ]
    });
  };
  </code></pre>
  
  <p>Inside vendor/rxjs I have all files that are under node_modules/rxjs. There is no file like index.js.</p>