title: Angular2 too many file requests on load
body: <p>I'm making a website using <code>Angular2</code> and I'm having what i suppose is an issue. On the first load of my angular page, <code>SystemJS</code> is making more than 500 hundred requests to retrieve every <code>Angular2</code> file in <code>angular2/src</code> directory. In total, the first load downloads more than 4MB and it takes more than 14 seconds to start.</p>
  
  <p>My <code>index.html</code> does the following scripts includes:</p>
  
  <pre><code>&lt;script src="libs/angular2/bundles/angular2-polyfills.js"&gt;&lt;/script&gt;
  &lt;script src="libs/systemjs/dist/system.src.js"&gt;&lt;/script&gt;
  &lt;script src="libs/rxjs/bundles/Rx.js"&gt;&lt;/script&gt;
  &lt;script src="libs/angular2/bundles/angular2.min.js"&gt;&lt;/script&gt;
  &lt;script src="libs/angular2/bundles/http.dev.js"&gt;&lt;/script&gt;
  &lt;script src="libs/jquery/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="libs/lodash/lodash.js"&gt;&lt;/script&gt;
  &lt;script src="libs/bootstrap/js/bootstrap.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>And my systemJs initialization code looks like this:</p>
  
  <pre><code>    &lt;script&gt;
        System.config({
          defaultJSExtensions: true,
          paths: {
            '*': 'libs/*',
            'app/*': 'app/*'
          },
          packageConfigPaths: ['libs/*/package.json'],
          packages: {
            app: {
              format: 'register',
              defaultExtension: 'js'
            }
          }
        });
        System.import('app/main')
              .then(null, console.error.bind(console));
  
      &lt;/script&gt;
  </code></pre>
  
  <p>My public folder has the following structure:</p>
  
  <pre><code>.
  ├── img
  ├── styles
  ├── app
  ├── libs
  |   └── angular2
  |   └── systemjs
  |   └── rxjs
  |   └── jquery
  |   └── lodash
  |   └── bootstrap
  └── index.html
  </code></pre>
  
  <p>A couple of screenshots of some of the js files that are being requested:
  <a href="https://i.stack.imgur.com/Srv3H.png"><img src="https://i.stack.imgur.com/Srv3H.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/2osfs.png"><img src="https://i.stack.imgur.com/2osfs.png" alt="enter image description here"></a></p>
  
  <p>Is there a way to avoid all of those requests?</p>