Search code examples
angularbundling-and-minification

bundle all JS file into one file for angular2 application


I am creating an angular 2 application.

Using "uglify", able to do minify the TS/JS file, but while rendering, Is that possible to combine all JS file into 1 file,

enter image description here


Solution

  • In Angular CLI builds, all TS/JS files are merged into one and minified for production builds out of the box. Read how to use it on https://cli.angular.io/. Angular CLI is still in Beta though, so you should be ready for changes, which might require a migrating process.