-1

How can I reduce the size of an Angularjs site using Google Closure Compiler? I have a site on Angularjs 1.8. x, but I want to compile it using Closure. How can this be done? If there are ready-made examples and demos?

'use strict';

// Declare app level module which depends on views, and core components
angular.module('myApp', [
  'ngRoute',
  'myApp.view1',
  'myApp.view2',
  'myApp.version'
]).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
  $locationProvider.hashPrefix('!');

  $routeProvider.otherwise({redirectTo: '/view1'});
}]);
LeMIT
  • 13
  • 3

1 Answers1

0

Can say much about closure compiler, but you can also checkout below optimizations for angular1.x:

Lazy Loading - Allows dynamic loading for js files. So the app's size is significantly reduced

Webpack Bundling - Allows minification / uglification of your code.

ankur1812
  • 97
  • 4