Search code examples
optimizationangularsystemjsnode-modules

Angular2, Loading modules with less server calls


'import {ComponentHere} from "angular2"', this one hits the server with so may calls for getting all the required file. Is there any way to decrease the number of calls to server?

//localhost:9739/node_modules/@angular/common/src/directives/core_directives.js. //localhost:9739/node_modules/@angular/common/src/pipes/uppercase_pipe.js". //localhost:9739/node_modules/@angular/common/src/forms/directives/control_container.js". etc..


Solution

  • Consider using a WebPack (https://angular.io/docs/ts/latest/guide/webpack.html) it normally will decreased the number of files sended to client (but they will be obviously bigger)